关闭“本地"帐户使用连接池时的OrientDB [英] Closing a "local" OrientDB when using connection pools
本文介绍了关闭“本地"帐户使用连接池时的OrientDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我基本上是这样做的.
So I basically do this.
OObjectDatabaseTx result = OObjectDatabasePool.global().acquire( "local:orientdb", "admin", "admin");
//dostuff
result.close;
问题是,当我重新部署Web应用程序时(不重新启动Java EE容器)时,出现以下错误:
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
我的意思是"Tomcat仍然有来自上一个应用程序的文件锁".
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()
和
new OObjectDatabaseTx("local:orientdb").close()
,但似乎都不起作用.有任何想法吗?有关此问题的文档尚不清楚.
but neither seem to work. Any ideas? The documentation isn't exactly clear on this issue.
推荐答案
将属性"storage.keepOpen"设置为false:
Set the property "storage.keepOpen" to false:
java ... -Dstorage.keepOpen=false ...
或通过Java代码:
OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue( false );
这篇关于关闭“本地"帐户使用连接池时的OrientDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文