Process is getting reinitated automatically after throwing org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

44 views
Skip to first unread message

Akhil Soman

unread,
Feb 4, 2021, 10:42:13 PM2/4/21
to jBPM Development
Hi

We are facing a strange issue in our production environment that the below exceptions is thrown by the engine after executing all the services tasks successfully and as a result the process execution is reinitiating from the beginning. we are not using the job executor also. all executions are happening in a synchronous fashion. as per the logs, we could see the exception is happening when trying to run an update query against ProcessInstanceLog table. below is the stack trace.

2021-02-04 12:48:07,820 INFO  [stdout] (default task-7) Hibernate: update ProcessInstanceLog set duration=?, end_date=?, externalId=?, user_identity=?, outcome=?, parentProcessInstanceId=?, processId=?, processInstanceDescription=?, processInstanceId=?, processName=?, processVersion=?, start_date=?, status=? where id=?
2021-02-04 12:48:07,821 WARN  [com.arjuna.ats.arjuna] (default task-7) ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffff7f000101:1a4a98c5:5ffc8606:48cacc2, org.wildfly.transaction.client.AbstractTransaction$AssociatingSynchronization@39e80469 >: javax.persistence.OptimisticLockException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.wrapStaleStateException(AbstractEntityManagerImpl.java:1800)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1705)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1677)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1683)

we are using jbpm 6.2 and running 2 instances of the application connected to the same database. attaching our bpmn file also for reference. 

any clue why this exception is happening and what is the reason behind the process is getting reinitiated automatically? can someone help in resolving this issue.

Thanks in advance
AdjustAccount.bpmn2
Reply all
Reply to author
Forward
0 new messages