Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Michael Asimakopoulos
    @masimplo
    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
    do anyone knows if is possible to define or create transactions using the http protocol over multiple requests?
    Roman Gordon
    @GoorMoon
    No it's not possible :(
    Daniel Ferreira Monteiro Alves
    @danfma
    hey @GoorMoon
    The only way to play with transactions on orientdb is to enlist the commands inside the Transactions property on some database object?
    Roman Gordon
    @GoorMoon
    Yes and then commit or rollback them
    Charles Pick
    @phpnode
    this of course means you can never use SQL transactionally, e.g. you can't do something like this:
    LET $a = CREATE VERTEX V SET foo = "bar"
    LET $edges = CREATE EDGE E FROM $a TO (SELECT FROM OUser)
    RETURN $edges
    Daniel Ferreira Monteiro Alves
    @danfma
    hummmm
    I was happy with Orient but this things are getting me sad
    another point is with integrity… it does not respect integrity of links by default and does not have a way to force it.
    Daniel Ferreira Monteiro Alves
    @danfma
    anyway, its a great db… if we could only workaround the transaction api ;)
    Luca Garulli
    @lvca
    Hi guys, executing multiple commands as transaction against a stateless protocol by definition, like HTTP, it's expensive in terms of keeping server side statuses and timeouts. But this could be done. Did you guys already open a new issue for that?
    Roman Gordon
    @GoorMoon
    @lvca , you mean open issue to support transaction over HTTP ?
    Charles Pick
    @phpnode
    TX over http is already supported via SQL batch
    Henry Hazan
    @henry-hz
    Hi guys, please, how can I make big queries to stream and process row by row ? once my selects returns millions of rows.... [here is an example using the mssql driver for node]
    Luca Garulli
    @lvca
    @GoorMoon I mean creating an open execution context created with a new "begin" command. After a timeout it could be rollbacked.
    Roman Gordon
    @GoorMoon
    @henry-hz, I think it's not posible in current approach for remote binary protocol.