Exception when closing database without dropping all indexes first
Please see this simple unit test: https://gist.github.com/4442120 If you comment out the line that drops the index before dropping the table:
/*
* **************************************************
* !!!! Comment out the following line and test will FAIL !!!
* *************************************************
*/
database.command(new OCommandSQL("DROP INDEX V.name UNIQUE")).execute();
the test will fail with:
com.orientechnologies.orient.core.exception.ODatabaseException: Database 'local:/tmp/orient_recreate' is closed
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.checkOpeness(ODatabaseRecordAbstract.java:985)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeSaveRecord(ODatabaseRecordAbstract.java:687)
at com.orientechnologies.orient.core.tx.OTransactionNoTx.saveRecord(OTransactionNoTx.java:77)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.save(ODatabaseRecordTx.java:240)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.save(ODatabaseRecordTx.java:36)
at com.orientechnologies.orient.core.record.ORecordAbstract.save(ORecordAbstract.java:294)
at com.orientechnologies.orient.core.record.ORecordAbstract.save(ORecordAbstract.java:285)
at com.orientechnologies.orient.core.type.tree.provider.OMVRBTreeEntryDataProviderAbstract.save(OMVRBTreeEntryDataProviderAbstract.java:166)
at com.orientechnologies.orient.core.type.tree.provider.OMVRBTreeEntryDataProviderAbstract.save(OMVRBTreeEntryDataProviderAbstract.java:156)
at com.orientechnologies.orient.core.type.tree.OMVRBTreeEntryPersistent.save(OMVRBTreeEntryPersistent.java:185)
at com.orientechnologies.orient.core.type.tree.OMVRBTreePersistent.commitChanges(OMVRBTreePersistent.java:517)
at com.orientechnologies.orient.core.type.tree.OMVRBTreeDatabaseLazySave.lazySave(OMVRBTreeDatabaseLazySave.java:70)
at com.orientechnologies.orient.core.index.OIndexMVRBTreeAbstract.lazySave(OIndexMVRBTreeAbstract.java:509)
at com.orientechnologies.orient.core.index.OIndexMVRBTreeAbstract.flush(OIndexMVRBTreeAbstract.java:104)
at com.orientechnologies.orient.core.index.OIndexManagerAbstract.flush(OIndexManagerAbstract.java:142)
at com.orientechnologies.orient.core.index.OIndexManagerAbstract.close(OIndexManagerAbstract.java:216)
at com.orientechnologies.orient.core.storage.OStorageAbstract.close(OStorageAbstract.java:109)
at com.orientechnologies.orient.core.storage.OStorageEmbedded.close(OStorageEmbedded.java:71)
at com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.close(OStorageLocal.java:346)
at com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.delete(OStorageLocal.java:373)
at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.drop(ODatabaseRaw.java:165)
at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.drop(ODatabaseWrapperAbstract.java:84)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.drop(ODatabaseRecordAbstract.java:201)
at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.drop(ODatabaseWrapperAbstract.java:84)
at com.orientechnologies.orient.core.db.ODatabaseRecordWrapperAbstract.drop(ODatabaseRecordWrapperAbstract.java:74)
Hi could you confirm that issue is fixed ?
Can not currently (traveling). Will try in the next couple of days.
On Sun, Jan 20, 2013 at 3:19 PM, Andrey Lomakin [email protected]:
Hi could you confirm that issue is fixed ?
— Reply to this email directly or view it on GitHubhttps://github.com/nuvolabase/orientdb/issues/1264#issuecomment-12471207.
http://about.me/milen
HI,
It took me a while but finally manged to check. Here is the test in case you are interested: https://github.com/azzazzel/graphdb-tests/blob/master/src/test/java/com/commsen/graphdbtests/orientdb/DropDatabaseWithIndexTest.java
It seams it works OK with OrientDB 1.4 SNAPSHOT. However if I run the test with OrientDB 1.3 (it will fail) and do NOT manually remove the DB files before trying with 1.4 SNAPSHOT I get:
com.orientechnologies.common.exception.OException: Error on creation of shared resource at com.orientechnologies.common.concur.resource.OSharedContainerImpl.getResource(OSharedContainerImpl.java:55) at com.orientechnologies.orient.core.metadata.OMetadata.init(OMetadata.java:105) at com.orientechnologies.orient.core.metadata.OMetadata.load(OMetadata.java:66) at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.open(ODatabaseRecordAbstract.java:121) at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:49) at com.orientechnologies.orient.core.db.graph.OGraphDatabase.open(OGraphDatabase.java:90) at com.commsen.graphdbtests.orientdb.DropDatabaseWithIndexTest.dropDB(DropDatabaseWithIndexTest.java:79) at com.commsen.graphdbtests.orientdb.DropDatabaseWithIndexTest.init(DropDatabaseWithIndexTest.java:24) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.NullPointerException at com.orientechnologies.orient.core.metadata.schema.OSchemaShared.fromStream(OSchemaShared.java:453) at com.orientechnologies.orient.core.type.ODocumentWrapperNoClass.reload(ODocumentWrapperNoClass.java:70) at com.orientechnologies.orient.core.metadata.schema.OSchemaShared$12.call(OSchemaShared.java:555) at com.orientechnologies.orient.core.storage.OStorageAbstract.callInLock(OStorageAbstract.java:168) at com.orientechnologies.orient.core.metadata.schema.OSchemaShared.load(OSchemaShared.java:550) at com.orientechnologies.orient.core.metadata.OMetadata$1.call(OMetadata.java:109) at com.orientechnologies.orient.core.metadata.OMetadata$1.call(OMetadata.java:105) at com.orientechnologies.common.concur.resource.OSharedContainerImpl.getResource(OSharedContainerImpl.java:53) ... 31 more
com.orientechnologies.common.exception.OException: Error on creation of shared resource at com.orientechnologies.common.concur.resource.OSharedContainerImpl.getResource(OSharedContainerImpl.java:55) at com.orientechnologies.orient.core.metadata.OMetadata.init(OMetadata.java:105) at com.orientechnologies.orient.core.metadata.OMetadata.load(OMetadata.java:66) at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.open(ODatabaseRecordAbstract.java:121) at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:49) at com.orientechnologies.orient.core.db.graph.OGraphDatabase.open(OGraphDatabase.java:90) at com.commsen.graphdbtests.orientdb.DropDatabaseWithIndexTest.dropDB(DropDatabaseWithIndexTest.java:79) at com.commsen.graphdbtests.orientdb.DropDatabaseWithIndexTest.cleanup(DropDatabaseWithIndexTest.java:32) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:36) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.NullPointerException at com.orientechnologies.orient.core.metadata.schema.OSchemaShared.fromStream(OSchemaShared.java:453) at com.orientechnologies.orient.core.type.ODocumentWrapperNoClass.reload(ODocumentWrapperNoClass.java:70) at com.orientechnologies.orient.core.metadata.schema.OSchemaShared$12.call(OSchemaShared.java:555) at com.orientechnologies.orient.core.storage.OStorageAbstract.callInLock(OStorageAbstract.java:168) at com.orientechnologies.orient.core.metadata.schema.OSchemaShared.load(OSchemaShared.java:550) at com.orientechnologies.orient.core.metadata.OMetadata$1.call(OMetadata.java:109) at com.orientechnologies.orient.core.metadata.OMetadata$1.call(OMetadata.java:105) at com.orientechnologies.common.concur.resource.OSharedContainerImpl.getResource(OSharedContainerImpl.java:53) ... 30 more
On Sun, Jan 20, 2013 at 9:51 PM, Milen Dyankov [email protected]:
Can not currently (traveling). Will try in the next couple of days.
On Sun, Jan 20, 2013 at 3:19 PM, Andrey Lomakin [email protected]:
Hi could you confirm that issue is fixed ?
— Reply to this email directly or view it on GitHubhttps://github.com/nuvolabase/orientdb/issues/1264#issuecomment-12471207.
http://about.me/milen
http://about.me/milen
Ok, so I'm closing it.