SuperState - StaleObjectStateException when timer signals the token
-------------------------------------------------------------------
Key: JBPM-2589
URL:
https://jira.jboss.org/jira/browse/JBPM-2589
Project: jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 3.2.6.SP1
Environment: Win XP, HSQL, JBOSS 4.2.3
Reporter: Adrian Apthorp
When I configure a timer on a superstate a StaleObjectStateException is raised when the
timer is fired.
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction
(or unsaved-value mapping was incorrect): [org.jbpm.graph.exe.Token#578]
at
org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1765)
at
org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2407)
at
org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2307)
at
org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2607)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:92)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:142)
at
org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at
org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
at
com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)
at
com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)
at com.arjuna.ats.arjuna.AtomicAction.end(AtomicAction.java:216)
at
com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commit(TransactionImple.java:240)
at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:501)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:361)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:527)
at org.jboss.ejb.Container.invoke(Container.java:960)
at
org.jboss.ejb.txtimer.TimedObjectInvokerImpl.callTimeout(TimedObjectInvokerImpl.java:99)
at org.jboss.ejb.txtimer.TimerImpl$TimerTaskImpl.run(TimerImpl.java:561)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
In the following example the timer works correctly on the state node but fails on the
superstate timer. Also, it seems that the timer fires for both sub-states (the message is
reported twice). When I remove one of the substates the exception still occurs with the
message reported once.
<state name="State 1">
<timer duedate="20 seconds" repeat="20 seconds" name="late
leaving">
<script>
System.out.println("What are we waiting for ? ");
</script>
</timer>
<transition to="Moving" name="depart"></transition>
</state>
<super-state name="Moving">
<state name="Stopped">
<transition to="Started" name="start"></transition>
</state>
<state name="Started">
<transition to="Stopped" name="stop"></transition>
</state>
<timer duedate="30 seconds" repeat="30 seconds">
<script>
System.out.println("We're late ");
</script>
</timer>
<transition to="end-state1" name="arrive"></transition>
</super-state>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira