[jboss-user] [jBPM Users] - Re: StaleObjectException in JBPM 4.0

jbarrez do-not-reply at jboss.com
Tue Aug 25 08:33:13 EDT 2009

I quickly went trough your unit test:

* You have at least 2 threads: the JUnit thread and x jobexecutor threads

* The JUnit thread does executes all your codes until the end. At that point, the teardown() message is called causing your processdefinition to be deleted.

* However, the JobExecutor thread is still around. Now he comes into play and tries to execute some activity of a process definition that doesn't exist anymore.

Hence, your error message ("deleted by another transaction")

Try to add Thread.sleep(10000) at the end of your unit test. It should work now. The reason why it works sometimes is because sometimes the jobexecutor is scheduled before the JUnit thread (damn parallel programming ;-)

Hope this helps

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4251457#4251457

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4251457

More information about the jboss-user mailing list