unexpected: ODatabaseException: Database is closed

623 views
Skip to first unread message

Riccardo Tasso

unread,
Feb 24, 2015, 5:41:19 AM2/24/15
to orient-...@googlegroups.com

Hi, I am migrating my application to Orient 2.0.3, from 1.7.10.

I have a UnitTest which throws an Exception, and I can't figure out why. Here is the stacktrace:

Running it.celi.cbook.temp.OrientCloseDatabaseTest
feb 24, 2015 11:36:36 AM com.orientechnologies.common.log.OLogManager log
INFORMAZIONI: OrientDB auto-config DISKCACHE=4.061MB (heap=1.748MB os=7.857MB disk=23.038MB)
feb 24, 2015 11:36:37 AM com.orientechnologies.common.log.OLogManager log
AVVERTENZA: {db=temp} Requested command 'Committing the active transaction to create the new type 'Person' as subclass of 'V'. The transaction will be reopen right after that. To avoid this behavior create the classes outside the transaction' must be executed outside active transaction: the transaction will be committed and reopen right after it. To avoid this behavior execute it outside a transaction
feb 24, 2015 11:36:37 AM com.orientechnologies.common.log.OLogManager log
AVVERTENZA: {db=temp} Requested command 'Committing the active transaction to create the new type 'City' as subclass of 'V'. The transaction will be reopen right after that. To avoid this behavior create the classes outside the transaction' must be executed outside active transaction: the transaction will be committed and reopen right after it. To avoid this behavior execute it outside a transaction
feb 24, 2015 11:36:37 AM com.orientechnologies.common.log.OLogManager log
AVVERTENZA: {db=temp} Requested command 'Committing the active transaction to create the new type 'lives' as subclass of 'E'. The transaction will be reopen right after that. To avoid this behavior create the classes outside the transaction' must be executed outside active transaction: the transaction will be committed and reopen right after it. To avoid this behavior execute it outside a transaction
Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.194 sec <<< FAILURE! - in it.celi.cbook.temp.OrientCloseDatabaseTest
test1(it.celi.cbook.temp.OrientCloseDatabaseTest)  Time elapsed: 0.027 sec  <<< ERROR!
com.orientechnologies.orient.core.exception.ODatabaseException: Database 'memory:temp' is closed
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.checkOpeness(ODatabaseDocumentTx.java:2590)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.executeReadRecord(ODatabaseDocumentTx.java:1527)
at com.orientechnologies.orient.core.tx.OTransactionNoTx.loadRecord(OTransactionNoTx.java:80)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.load(ODatabaseDocumentTx.java:1424)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.load(ODatabaseDocumentTx.java:117)
at com.orientechnologies.orient.core.id.ORecordId.getRecord(ORecordId.java:313)
at com.tinkerpop.blueprints.impls.orient.OrientVertexIterator.createWrapper(OrientVertexIterator.java:52)
at com.tinkerpop.blueprints.impls.orient.OrientVertexIterator.createWrapper(OrientVertexIterator.java:34)
at com.orientechnologies.orient.core.iterator.OLazyWrapperIterator.hasNext(OLazyWrapperIterator.java:79)
at com.orientechnologies.common.collection.OMultiCollectionIterator.getNextPartial(OMultiCollectionIterator.java:169)
at com.orientechnologies.common.collection.OMultiCollectionIterator.hasNext(OMultiCollectionIterator.java:69)
at com.orientechnologies.orient.core.sql.method.misc.OSQLMethodField.execute(OSQLMethodField.java:66)
at com.orientechnologies.orient.core.sql.methods.OSQLMethodRuntime.execute(OSQLMethodRuntime.java:139)
at com.orientechnologies.orient.core.sql.filter.OSQLFilterItemAbstract.transformValue(OSQLFilterItemAbstract.java:140)
at com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime.execute(OSQLFunctionRuntime.java:128)
at com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime.getValue(OSQLFunctionRuntime.java:142)
at com.orientechnologies.orient.core.sql.filter.OSQLFilterCondition.evaluate(OSQLFilterCondition.java:307)
at com.orientechnologies.orient.core.sql.filter.OSQLFilterCondition.evaluate(OSQLFilterCondition.java:80)
at com.orientechnologies.orient.core.sql.filter.OSQLFilterCondition.evaluate(OSQLFilterCondition.java:313)
at com.orientechnologies.orient.core.sql.filter.OSQLFilterCondition.evaluate(OSQLFilterCondition.java:79)
at com.orientechnologies.orient.core.sql.filter.OSQLFilterCondition.evaluate(OSQLFilterCondition.java:313)
at com.orientechnologies.orient.core.sql.filter.OSQLFilterCondition.evaluate(OSQLFilterCondition.java:79)
at com.orientechnologies.orient.core.sql.filter.OSQLFilter.evaluate(OSQLFilter.java:100)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLResultsetAbstract.evaluateRecord(OCommandExecutorSQLResultsetAbstract.java:386)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLResultsetAbstract.filter(OCommandExecutorSQLResultsetAbstract.java:376)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.executeSearchRecord(OCommandExecutorSQLSelect.java:505)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.fetchFromTarget(OCommandExecutorSQLSelect.java:1315)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.executeSearch(OCommandExecutorSQLSelect.java:433)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.execute(OCommandExecutorSQLSelect.java:391)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.execute(OCommandExecutorSQLDelegate.java:64)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.executeCommand(OAbstractPaginatedStorage.java:1184)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.command(OAbstractPaginatedStorage.java:1173)
at com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OSQLQuery.java:71)
at com.orientechnologies.orient.core.sql.query.OSQLSynchQuery.run(OSQLSynchQuery.java:85)
at com.orientechnologies.orient.core.query.OQueryAbstract.execute(OQueryAbstract.java:33)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.query(ODatabaseDocumentTx.java:630)
at it.celi.cbook.temp.OrientCloseDatabaseTest.test1(OrientCloseDatabaseTest.java:77)


The problem seems to be that I'm executing a query over a closed database. Anyway it should not be closed, since it's a pool.
The strange thing is also that with another query (test2) which doesn't involve edges, the exception is not thrown.

Am I using the API in a wrong way?
Looking at documentation ( http://www.orientechnologies.com/docs/last/orientdb.wiki/Graph-Factory.html ) everything seems ok.

Thanks,
   Riccardo
OrientCloseDatabaseTest.java

Riccardo Tasso

unread,
Feb 25, 2015, 7:24:42 AM2/25/15
to orient-...@googlegroups.com
Any hint please?

--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Riccardo Tasso

unread,
Mar 2, 2015, 11:16:11 AM3/2/15
to orient-...@googlegroups.com
It seems that one of the quickest way to release a OrienDatabase from pool without releasing it it's the following:

public static void closeQuietly(ODatabaseDocument db) {
try {
if (isNotNull(db)) {
OrientGraph graph = new OrientGraph(db.getURL());
graph.shutdown();
}
} catch (Exception ignored) {
log.error("Error closing db:: ", ignored);
}
}

It sounds a bit strange but works.

Riccardo 

Luca Garulli

unread,
Mar 2, 2015, 1:23:23 PM3/2/15
to orient-database
Riccardo,
I've created a new issue:


@tglman is assigned on it.

Lvc@


--

Emanuel

unread,
Mar 2, 2015, 1:35:51 PM3/2/15
to orient-...@googlegroups.com
Hi Riccardo,

Can you post the test case on the issue, that will help a lot us ;)

bye

Emanuel

Emanuele

unread,
Mar 2, 2015, 1:38:08 PM3/2/15
to orient-...@googlegroups.com
Hi Riccardo,

I saw it now sorry, it's not needed to add it to the issue ;)

bye

Riccardo Tasso

unread,
Mar 3, 2015, 2:39:57 AM3/3/15
to orient-...@googlegroups.com
Thank you guys.

Riccardo

--
Reply all
Reply to author
Forward
0 new messages