Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Tomas Bosak
    @yojimbo87
    hmm it seems to be a little tricky
    the question is if you have to specify length of header or just continue with it's content which should consist of field definitions
    Roman Gordon
    @GoorMoon
    yea, and than record haze a schema header is different in field_name_length is value negative and doesn't have all fields
    Just continue with its content but with variations
    And in the field pointer_to_data_structure you must supply position in data segment this vary on data_type
    Tomas,
    I must go, please enter to the chat than you have a time.
    Glad to speak with you
    Tomas Bosak
    @yojimbo87
    I would try to check java version of the driver to see how it works there because without examples it's really hard to say how it should work
    or maybe ask luca on the google groups to provide examples
    in the old docs there were raw examples how the serialization was done so if the definition wasn't clear you could deduce it from there
    Michael Asimakopoulos
    @masimplo
    Hi, is it possible to use the .Net driver to call a stored javascript function by name? similar to OFunction sum = graph.getRawGraph().getMetadata().getFunctionLibrary().getFunction("sum");
    Roman Gordon
    @GoorMoon
    Didn't try this :(, but you can call javascript by database.javascript()
    Michael Asimakopoulos
    @masimplo
    yes, I am aware of this, But I have made 10 or so named function with parameters using the studio and I am looking for a way to invoke them without having them rewritten in the c# code
    Roman Gordon
    @GoorMoon
    Can you produce some test case and i will look how this can be done.
    Roman Gordon
    @GoorMoon
    in console can do this select sum(2,3)
    Michael Asimakopoulos
    @masimplo
    I open the studio on 2480 port and go to Function tab. I create a function like: http://i.imgur.com/0qpVqjv.png
    I then want to call this function like: myFunction(15);
    in Java I guess it would be OFunction myFunction= graph.getRawGraph().getMetadata().getFunctionLibrary().getFunction("myFunction");
    Map<String,Object> params = new HashMap<String,Object>();
    params.put("id", 15);
    Number result = myFunction.execute(params);
    Roman Gordon
    @GoorMoon
    Thank, i looking how implement such functionality
    Roman Gordon
    @GoorMoon

    Implemented by this way

    var result = database
        .JavaScript("sum(a,b);")
        .Set("a",3)
        .Set("b",5)
        .Run()
        .ToSingle();

    https://github.com/orientechnologies/OrientDB-NET.binary/blob/master/src/Orient/Orient.Tests/Query/JavascriptTest.cs#L62

    Roman Gordon
    @GoorMoon

    Hello,
    I'm implemented parsing of Tree based RidBag, but don't love what i did.
    https://github.com/orientechnologies/OrientDB-NET.binary/blob/master/src/Orient/Orient.Client/Protocol/Serializers/RecordCSVSerializer.cs#L615

    Parser needs to connection to correctly parse the tree.
    Can this be done better ?

    Roman Gordon
    @GoorMoon
    @/all can please advise me ?
    Roman Gordon
    @GoorMoon
    @prah-net are you here ?
    Prahlad Kumar Sharma
    @prah-net
    Hi @GoorMoon , I am here now
    Peter(Yong) Zhong
    @jiujiu1123

    @GoorMoon I was trying to fix issue 6, because I really need to create many vertexs together and this issue always prevent me from doing so. I tried to re-create an BufferedStream on the catch block of the send(byte[]) method and re send the data.

    private void Send(byte[] rawData)
    {
        if ((_networkStream != null) && _networkStream.CanWrite)
        {
            try
            {
                _networkStream.Write(rawData, 0, rawData.Length);
            }
            catch (Exception ex)
            {
                try
                {
                    _networkStream= new BufferedStream(_socket.GetStream());
                    _networkStream.Write(rawData, 0, rawData.Length);
                }
                catch
                {
                    throw new OException(OExceptionType.Connection, ex.Message, ex.InnerException);
                }
            }
        }
    }

    This is my changed code, but what I am a bit confused of is the error does not throw until (poolsize-1)th operation(RecordCreate in my case) and it seems after that every operation will cause the code to throw the error again, so it's not really a fix. Do you have any ideas?
    PS: My test

    using (var database = Settings.GetDatabase())
                {
                    for (var i = 0; i < 22; i++)
                    {
                        Console.WriteLine( database
                        .Create
                        .Vertex("users")
                        .Set("u_name", "name")
                        .Run().ORID.RID);
                    }
                }
    Roman Gordon
    @GoorMoon
    Hi,
    If i understand right you using 2.0-rc1 ?
    Driver have some issues with DatabasePool, that can case such problem than protocol version mismatch.
    Peter(Yong) Zhong
    @jiujiu1123
    no, all i did is put the create statement in a for loop
    like the test I posted
    I am aware of the issue for 2.0-rc1
    Roman Gordon
    @GoorMoon
    I will check this asap
    Peter(Yong) Zhong
    @jiujiu1123
    @GoorMoon the I ran into the buffered steam issue today again with 1.7.9 so I slightly mortified one line of code, but I don't like what I did, do you have any other ideas? I changed my original fix that I brought up to this.
    My code
            internal Stream GetNetworkStream()
            {
                return new BufferedStream(_networkStream);
            }
    Roman Gordon
    @GoorMoon
    @jiujiu1123 _networkStream already BufferedStream look here:
    https://github.com/orientechnologies/OrientDB-NET.binary/blob/master/src/Orient/Orient.Client/Protocol/Connection.cs#L14
    I investigate issue and i think problem is with Memory Storage Type, is return different structure of RECORD_LOAD, RECORD_CREATE
    Peter(Yong) Zhong
    @jiujiu1123
    I know it is already buffered but it I think what happened is the buffed stream can not do read and write at the same time, but I am not too familiar with the streams so
    Roman Gordon
    @GoorMoon
    in last commit i added READ_TIMEOUT to the socket and now if have protocol mismatch thrown IOException.
    Uploaded to github just now
    Peter(Yong) Zhong
    @jiujiu1123
    oh, I was just looking over your commits, explains why I didn't find it
    Roman Gordon
    @GoorMoon
    i just now uploaded it :)
    Peter(Yong) Zhong
    @jiujiu1123
    I will give it a try, but from what I understand I think this issue is caused by the bufferedstream it self not the tcpsocket, but anyway I could be wrong
    Roman Gordon
    @GoorMoon
    BufferStream is wait for data, and data is already sent because difference in storage types.
    Daniel Ferreira Monteiro Alves
    @danfma
    hey guys! How is working the transaction API on .NET? I really could not understand the API.
    Roman Gordon
    @GoorMoon
    hey, you just add to transactions documents or vertex like this database.Transaction.Add(someDocument); database.Transaction.Commit();
    Charles Pick
    @phpnode
    @GoorMoon does that use SQL batch under the hood, or the original TX api?
    Roman Gordon
    @GoorMoon
     This is original TX api via remote protocol.
    Charles Pick
    @phpnode
    @GoorMoon does that work when creating edges etc? had big problems with that in oriento
    Roman Gordon
    @GoorMoon
    @phpnode ,
    Remote protocol is low level protocol and you need to create edge and vertex manualy link them. Yes it's work but realy ugly :(
    Look here https://github.com/orientechnologies/OrientDB-NET.binary/blob/master/src/Orient/Orient.NUnit/Query/TestTransactions.cs#L174
    Charles Pick
    @phpnode
    oh man
    Daniel Ferreira Monteiro Alves
    @danfma
    hi guys
    yes the transaction api on this client is very ugly