Hi,
hibernate version :
2.1.1
database :
hypersonic
error (occurs only when in non-debug-mode) : '
object references an unsaved transient instance' thrown at Transaction.commit()
Code:
org.jbpm.PersistenceException: couldn't commit jbpm managed transaction : couldn't flush hibernate session (object references an unsaved transient instance - save the transient instance before flushing: org.jbpm.model.log.impl.InvocationLogImpl) couldn't commit transaction (object references an unsaved transient instance - save the transient instance before flushing: org.jbpm.model.log.impl.InvocationLogImpl)
at org.jbpm.persistence.hibernate.HibernateSessionJmtTx.commitAndClose(HibernateSessionJmtTx.java:54)
at org.jbpm.service.ExecutionServiceJmt.endOfState(ExecutionServiceJmt.java:71)
at org.jbpm.service.ExecutionServiceJmt.endOfState(ExecutionServiceJmt.java:58)
at org.jbpm.service.ExecutionServiceJmt.endOfState(ExecutionServiceJmt.java:54)
at org.jbpm.service.UndoTest.testStateUndo(UndoTest.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:397)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:281)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:173)
Since the problem does not occur in debug mode, I have troubles finding the cause. Any hint or pointer is appreciated.
Some thoughts :
* The object saved in the session is the processInstance
- processInstance has a many-to-one relation to a token
Code:
<many-to-one name="root" class="org.jbpm.model.execution.impl.TokenImpl" cascade="all"/>
- a token has a set of invocation logs
Code:
<set name="invocationLogs" lazy="true" cascade="all" sort="natural">
<key column="token" />
<one-to-many class="org.jbpm.model.log.impl.InvocationLogImpl" />
</set>
* The error occurs in a JUnit test.
* I know hypersonic only supports isolation level 0 (READ_UNCOMMITTED!) but since the problem occurs repeatably in a JUnit test. And a JUnit test is executed in a single threaded, right ? So that couldn't be the problem.
* Sometimes the problem disappears when changing unrelated pieces of code. At least to my knowledge they are unrelated. This would indicate a multithreading issue, ... hmmm
* I never get any messages from hibernate saying that I forgot to close sessions. So I guess the Session.finalize would check that, right ?
* Does anybody know of hibernate or hypersonic behaviour that is different in normal versus debug mode ?
Regards, Tom.