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


2015-11-03 10:31 GMT+01:00 Riccardo Tasso <[email protected]>:

> I forgot to specify that now I'm using Orien 2.1.5.
>
>
> Il giorno martedì 3 novembre 2015 10:30:48 UTC+1, Riccardo Tasso ha
> scritto:
>>
>> 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
>>
> --
>
> ---
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to