Question

So I basically do this.

OObjectDatabaseTx result = OObjectDatabasePool.global().acquire( "local:orientdb", "admin", "admin");
//dostuff
result.close;

The problem is that when I redeploy my webapp (without restarting the Java EE container) I get the folling error:

com.orientechnologies.orient.core.exception.OStorageException: Cannot open local storage 'orientdb' with mode=rw

which I interpret to mean "Tomcat still has a filelock from the last app".

So my question is how do I cleanly exit in this scenario? I've tried:

OObjectDatabasePool.global().close()

and

new OObjectDatabaseTx("local:orientdb").close()

but neither seem to work. Any ideas? The documentation isn't exactly clear on this issue.

Was it helpful?

Solution

Set the property "storage.keepOpen" to false:

java ... -Dstorage.keepOpen=false ...

or via Java code:

OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue( false );
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top