orientechnologies / orientdb-gremlin

TinkerPop3 Graph Structure Implementation for OrientDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in multi-threaded environment - getIndexManager

ttschampel opened this issue · comments

When executing in a multi-threaded environment I get errors from calls into OrientGraph.getIndexManager()

Adding makeActiveDb() to the method fixed the problem locally for me.

For OrientDB the rule is that one database instance can be used by a thread, because database instances are not thread safe.
orientechnologies/orientdb#5490 (comment)
#16
http://orientdb.com/docs/last/Java-Multi-Threading.html

I saw the multithreading docs for OrientDB and the accompanying calls to makeActive() in the OrientGraph. My use case was executing a traversal during a txn (checking for the existence of a vertex) which indirectly hit the index manager.

Are you saying things are executing as expected? Perhaps I'm improperly using the API?

I haven't actually tried to explicitly call makeActive when sharing the graph instance - I always went for multiple graph instances (one per thread).

I see #112 has been pulled in. This can be marked as a duplicate of that issue - the changes for 112 are the same I did for a local workaround to get past this problem.