I wrote a class in Java which implements the OrientDB API and can execute a few queries. In this class, I also set up the connection to the database:
OrientDB orient = new OrientDB("remote:localhost", "root", %password%, OrientDBConfig.defaultConfig()); ODatabaseSession db = orient.open("SwFw", "admin", "admin");
Now I want to use my OrientDB class in another class, where I create multiple instances of the OrientDB class. Then, when i execute methods form my OrientDB class, which perform different search queries, I sometimes get the error
The current database instance(com.orientechnologies.orient.core.db.document.ODatabaseDocumentRemote@4c7120a4) is not active on the current thread
If I execute the function again, it works. Is there any way to prevent this?