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.

有帮助吗?

解决方案

Set the property "storage.keepOpen" to false:

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

or via Java code:

OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue( false );
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top