Closing a “local” OrientDB when using connection pools

非 Y 不嫁゛ 提交于 2019-12-19 03:36:09

问题


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.


回答1:


Set the property "storage.keepOpen" to false:

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

or via Java code:

OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue( false );


来源:https://stackoverflow.com/questions/18383154/closing-a-local-orientdb-when-using-connection-pools

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!