These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: different behaviour in run- and debug-mode ?
PostPosted: Tue Apr 13, 2004 6:27 am 
JBoss jBPM Developer
JBoss jBPM Developer

Joined: Thu Aug 28, 2003 11:56 am
Posts: 30
Location: Belgium
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 20, 2004 11:17 am 
Newbie

Joined: Thu Apr 01, 2004 2:19 pm
Posts: 14
did you find out the issue? How did you resolve it ?


Top
 Profile  
 
 Post subject: nope
PostPosted: Thu Apr 22, 2004 2:52 pm 
JBoss jBPM Developer
JBoss jBPM Developer

Joined: Thu Aug 28, 2003 11:56 am
Posts: 30
Location: Belgium
nope, I still didn't find an answer.

But the real funny part is that it only occurs when I run it in my test suite (the master test that just includes all the other tests). The problem arises and disappears when changing the order of the tests :-s

still beats me ...

Regards, Tom.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.