AnsweredAssumed Answered

Hibernate StaleObjectStateException

Question asked by kma on Dec 19, 2007
Hi,

I have created a workflow definition where I use timers, when I execute
the workflow I do get the exception shown below.
As far as I can see this happens when 2 timers 'time out'
at the same time.

Any idea ?

My environment is Alfresco 2.1 Community, MySQL 5.0.45
and Windows XP.

Thanks,
Karsten


    09:38:06,239 DEBUG [org.jbpm.taskmgmt.exe.TaskInstance] assigning task 'ooTimerTask-s1Alarm' to 'admin'
    09:38:06,239 DEBUG [org.jbpm.graph.def.GraphElement] event 'task-assign' on 'Task(ooTimerTask-s1Alarm)' for 'Token(/)'
    09:38:06,255 WARN  [org.jbpm.graph.exe.Token] lock owner 'token[57]' tries to unlock token '57' which is not locked
    09:38:06,255 DEBUG [org.jbpm.graph.exe.Token] token[57] is unlocked by token[57]
    09:38:06,255 DEBUG [org.jbpm.db.JobSession] deleting timer(ooTimerTask-s3Alarm,09:38:05,000)
    09:38:06,255 DEBUG [org.jbpm.JbpmContext] closing JbpmContext
    09:38:06,255 DEBUG [org.jbpm.svc.Services] closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@187108a
    09:38:06,255 DEBUG [org.jbpm.persistence.db.DbPersistenceService] committing hibernate transaction
    09:38:06,286 ERROR [org.jbpm.persistence.db.DbPersistenceService] hibernate commit failed
    org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.alfresco.repo.workflow.jbpm.AlfrescoTimer#1497]
       at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1714)
       at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2473)
       at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2647)
       at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:74)
       at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:144)
       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:253)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:211)
       at org.jbpm.svc.Services.close(Services.java:222)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.java:181)
       at org.alfresco.repo.workflow.jbpm.AlfrescoJobExecutorThread.access$001(AlfrescoJobExecutorThread.java:38)
       at org.alfresco.repo.workflow.jbpm.AlfrescoJobExecutorThread$TransactionJob.execute(AlfrescoJobExecutorThread.java:84)
       at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:225)
       at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:155)
       at org.alfresco.repo.workflow.jbpm.AlfrescoJobExecutorThread.executeJob(AlfrescoJobExecutorThread.java:57)
       at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:62)
    09:38:06,286 DEBUG [org.jbpm.persistence.db.DbPersistenceService] rolling back hibernate transaction
    09:38:06,317 DEBUG [org.jbpm.persistence.db.DbPersistenceService] closing hibernate session
    09:38:06,317 ERROR [org.jbpm.svc.Services] problem closing service 'persistence'

Outcomes