What causes org.hibernate.StaleObjectStateException while working with jBPM5 ?

Solution Verified - Updated -

Issue

  • I have created a business process in jBPM5. After processing the flow for few times the flow is giving the following ERROR.
    Just for your information I am running on WebSphere Application Server (WAS) 8 , and I am using the jBPM 5.x which comes with JBoss Enterprise BRMS Platform 5.3 .
    Can you please advise me what is causing this ERROR?
java.lang.RuntimeException: Could not commit transaction
    at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:1011)
    at org.jbpm.task.service.TaskServiceSession.getContent(TaskServiceSession.java:589)
    at org.jbpm.task.service.local.LocalTaskService.getContent(LocalTaskService.java:130)
    at org.jbpm.process.workitem.wsht.SyncWSHumanTaskHandler$TaskCompletedHandler.handleCompletedTask(SyncWSHumanTaskHandler.java:343)
        .....
Caused by: java.lang.RuntimeException: Unable to commit transaction
    at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:182)
    at org.jbpm.task.service.persistence.TaskJTATransactionManager.commit(TaskJTATransactionManager.java:56)
    at org.jbpm.task.service.persistence.TaskPersistenceManager.endTransaction(TaskPersistenceManager.java:94)
    at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:999)
        .....
Caused by: javax.transaction.RollbackException
    at com.ibm.tx.jta.impl.TransactionImpl.stage3CommitProcessing(TransactionImpl.java:1258)
    at com.ibm.tx.jta.impl.TransactionImpl.processCommit(TransactionImpl.java:1028)
    at com.ibm.tx.jta.impl.TransactionImpl.commit(TransactionImpl.java:949)
        .....
Caused by: javax.persistence.OptimisticLockException
    at org.hibernate.ejb.AbstractEntityManagerImpl.wrapStaleStateException(AbstractEntityManagerImpl.java:627)
    at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:588)
    at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:513)
        .....    
Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.task.Task#5]
    at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1782)
    at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2425)
    at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2325)
    at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2625)
    at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115)
    at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
        .....

Environment

  • Red Hat JBoss Enterprise Business Rules Management System Platform (BRMS)

    • 5.3.x
  • jBPM

    • 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.