我知道有关于这个主题的问题,我在Closing a "local" OrientDB when using connection pools找到了。 但它无法解决我的问题,即: 我有代码
OrientGraphFactory ogf = new OrientGraphFactory("plocal:/opt/orientdb/databases/sad", "admin", "admin");
if(ogf.exists()){
System.out.println("Database exist");
}
else
System.out.println("Database NOT exist");
OrientGraph og = ogf.getTx();
Vertex vPerson = og.addVertex("class:My");
vPerson.setProperty("city", "Almaty");
vPerson.setProperty("city", "Astana");
System.out.println(og.countVertices());
OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue( false );
og.shutdown();
ogf.close();
此后当我尝试通过console.sh与命令
连接时connect remote:localhost/sad root root
无法连接到错误的数据库:
Error: com.orientechnologies.orient.core.exception.OStorageException: Cannot open local storage '/opt/orientdb/databases/sad' with mode=rw
Error: com.orientechnologies.orient.core.exception.OSerializationException: Cannot load database's configuration. The database seems to be corrupted.
我还在orientdb-server-config.xml中添加了2行:
<properties>
<entry value="1" name="db.pool.min"/>
<entry value="50" name="db.pool.max"/>
<entry value="true" name="profiler.enabled"/>
<entry value="info" name="log.console.level"/>
<entry value="fine" name="log.file.level"/>
+ <entry name="cache.size" value="10000" />
+ <entry name="storage.keepOpen" value="false" />
</properties>
请帮助我。