orientdb-gremlin
orientdb-gremlin copied to clipboard
Session loss & connection management strategy
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 ?
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
is there anything on the orient server console?
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.