Executing OSQL Script: why current database instance is not active on current thread?

146 views
Skip to first unread message

Riccardo Tasso

unread,
Nov 3, 2015, 4:30:48 AM11/3/15
to OrientDB
Hi, I've already posted the question to StackOverflow, without any help: http://stackoverflow.com/questions/33409911/executing-osql-script-why-current-database-instance-is-not-active-on-current-th

Could you help me passing the attached Unit Test (the required resources are attached too)?

Briefly if I execute a DELETE command it fails only if there is some record in my db. The exception thrown is:

java.lang.IllegalStateException: Current database instance (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx@1e8ce150) is not active on current thread (Thread[main,5,main]). Current active database is: com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx@604f2bd2
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.checkIfActive(ODatabaseDocumentTx.java:3206)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2628)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2622)
at it.celi.orient.util.OrientScriptImporterTest$OrientScriptImporter.executeScriptFromFile(OrientScriptImporterTest.java:153)
at it.celi.orient.util.OrientScriptImporterTest$OrientScriptImporter.process(OrientScriptImporterTest.java:124)
at it.celi.orient.util.OrientScriptImporterTest.testWithPopulate(OrientScriptImporterTest.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)


Thanks,
  Riccardo
OrientScriptImporterTest.java
clean.osql
schema.osql

Riccardo Tasso

unread,
Nov 3, 2015, 4:31:12 AM11/3/15
to OrientDB
I forgot to specify that now I'm using Orien 2.1.5.

Luigi Dell'Aquila

unread,
Nov 3, 2015, 9:08:50 AM11/3/15
to orient-...@googlegroups.com
Hi Riccardo,

I just answered your question on StackOverflow. I can't make the test fail, so I cannot try the solution, but you can try to add a 

db.activateOnCurrentThread()

at the beginning of  executeScriptFromFile() method

Thanks

Luigi


--

---
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,
Nov 17, 2015, 2:33:45 AM11/17/15
to orient-...@googlegroups.com
The problem is still here...can you confirm that you can make this test pass?
Which JVM are you using?!

Riccardo
Reply all
Reply to author
Forward
0 new messages