[
https://jira.jboss.org/jira/browse/JBPM-2036?page=com.atlassian.jira.plug...
]
Martin Putz commented on JBPM-2036:
-----------------------------------
The problem is that the CancelTimerAction, which is invoked because the state is left,
deletes the timer, but since 'repeat' is defined, the Timer still tries to update
the dueDate attribute. When Hibernate attempts to persist this change, the
StaleObjectStateException is thrown because the timer has been deleted already:
2009-02-11 13:51:28,231 DEBUG [org.jbpm.job.Timer] executing
'Timer(timer-to-next-with-repeat,2009-02-11 13:51:28,187,Token(/))'
2009-02-11 13:51:28,238 DEBUG [org.jbpm.graph.def.GraphElement] event 'node-leave'
on 'State(catch crooks)' for 'Token(/)'
2009-02-11 13:51:28,240 DEBUG [org.jbpm.graph.def.GraphElement] executing action
'CancelTimerAction(6fdca5)'
2009-02-11 13:51:28,240 DEBUG [org.jbpm.db.JobSession] deleting timers by name
'timer-to-next-with-repeat' for Token(/)
2009-02-11 13:51:28,242 DEBUG [org.jbpm.db.JobSession] 1 timers by name
'timer-to-next-with-repeat' for Token(/) were deleted
2009-02-11 13:51:28,250 DEBUG [org.jbpm.job.Timer] updated
'Timer(timer-to-next-with-repeat,2009-02-11 13:51:33,187,Token(/))' for repetition
on '2009-02-11 13:51:33,187'
2009-02-11 13:51:28,257 ERROR [org.hibernate.event.def.AbstractFlushingEventListener]
Could not synchronize database state with session
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction
(or unsaved-value mapping was incorrect): [org.jbpm.job.Timer#88]
StaleObjectStateException when repeating timer signals the token
----------------------------------------------------------------
Key: JBPM-2036
URL:
https://jira.jboss.org/jira/browse/JBPM-2036
Project: JBoss jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: jBPM-3.2.5.SP1, jBPM 3.3.1 GA
Reporter: Martin Putz
Assignee: Thomas Diesler
Fix For: jBPM 3.2.6 GA
With the following timer definition on a state node
<state name='state1'>
<timer name='timer-to-end-with-repeat' duedate='1 second'
repeat='5 seconds'>
<action class='org.jbpm.scheduler.exe.TimerDbTest$Signal' />
</timer>
<transition name='to_state2' to='state2'/>
</state>
and the action class execute() method being
public void execute(ExecutionContext executionContext) throws Exception {
executionContext.leaveNode();
}
leads to:
2009-02-10 21:38:45,404 16508 ERROR
[org.hibernate.event.def.AbstractFlushingEventListener] (JbpmJobExecutor:127.0.0.1:1:)
Could not synchronize database state with session
org.hibernate.StaleObjectStateException: Row was updated or deleted by another
transaction (or unsaved-value mapping was incorrect): [org.jbpm.job.Timer#86]
at
org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1769)
at
org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2412)
at
org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2312)
at
org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2612)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:96)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)
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.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.jbpm.persistence.db.DbPersistenceService.commit(DbPersistenceService.java:226)
at
org.jbpm.persistence.db.DbPersistenceService.endTransaction(DbPersistenceService.java:131)
at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:197)
at org.jbpm.svc.Services.close(Services.java:243)
at org.jbpm.JbpmContext.close(JbpmContext.java:133)
at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.java:194)
at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:61)
If 'repeat' is not set, the token is leaving the state as expected.
--
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