orientdb-gremlin icon indicating copy to clipboard operation
orientdb-gremlin copied to clipboard

Session loss & connection management strategy

Open ndelaforge opened this issue 8 years ago • 3 comments

Hi all,

I am testing the couple orientdb-gremlin and gremlin-scala in production environment and I am experimenting data loss after some time. OrientDB is logging exceptions about unknown sessions :

com.orientechnologies.common.io.OIOException: Found unknown session 6
    at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.onBeforeRequest(ONetworkProtocolBinary.java:240)
    at com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.execute(OBinaryNetworkProtocolAbstract.java:214)
    at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:77)

So what is the best way to manage connection to OrientDB ?

ndelaforge avatar May 25 '16 12:05 ndelaforge

not sure what that error is about, would be better to ask the orient guys, they are typically quite responsive. i typically let orient handle the connection for me. all i do is

val graph: ScalaGraph[OrientGraph] = new OrientGraphFactory(url, user, pass).getNoTx.asScala

mpollmeier avatar May 26 '16 11:05 mpollmeier

is there anything on the orient server console?

mpollmeier avatar May 26 '16 11:05 mpollmeier

I am doing quite the same way.

  lazy val factory: OrientGraphFactory = new OrientGraphFactory(uri, user, passwd).setupPool(10)
  lazy val graphNoTx: ScalaGraph[OrientGraph] = factory.getNoTx(true, true).asScala

And com.orientechnologies.common.io.OIOException: Found unknown session X are from orient server console.

I guess this has something to do with the way I manage graph instances. My client app is also a server, so my graph instance is kept open. It looks like orientdb is closing sessions after some time.

ndelaforge avatar May 26 '16 12:05 ndelaforge