# ARJUNA016053: Could not commit transaction

**URL:** <https://community.ofelia.com/t/arjuna016053-could-not-commit-transaction/7844>\
**Category:** Q&A\
**Tags:** bonita-studio\
**Created:** [5 October 2016 14:18 UTC](https://community.ofelia.com/t/arjuna016053-could-not-commit-transaction/7844 "2016-10-05T14:18:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinicius\_8](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@vinicius\_8](https://community.ofelia.com/u/vinicius_8)\
**Post date:** [5 October 2016 14:18 UTC](https://community.ofelia.com/t/arjuna016053-could-not-commit-transaction/7844/1 "2016-10-05T14:18:27Z")

</div>

It is appearing the following error sometimes during the execution of some instances.

Sometimes when I try to change the value of a attribute in a business variable, it throws the following error and the task stops.

Please, how can I make the bonita engine to stop throwing this error?  
Here is the log:

```
9:42:22,221 ERROR [org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork] (Bonita-Worker-1-03) THREAD_ID=246 | HOSTNAME=ECOSIZEEDE01 | TENANT_ID=1 | The work [ExecuteFlowNodeWork: processInstanceId:6455, flowNodeInstanceId: 569597] failed. The failure will be handled.
09:42:22,267 ERROR [org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork] (Bonita-Worker-1-03) THREAD_ID=246 | HOSTNAME=ECOSIZEEDE01 | TENANT_ID=1 | org.bonitasoft.engine.transaction.STransactionCommitException : "PROCESS_DEFINITION_ID=5960294574315284012 | PROCESS_NAME=TIA | PROCESS_VERSION=1.1 | PROCESS_INSTANCE_ID=6455 | ROOT_PROCESS_INSTANCE_ID=6455 | FLOW_NODE_DEFINITION_ID=7657746571431238929 | FLOW_NODE_INSTANCE_ID=569597 | FLOW_NODE_NAME=Finalizar | javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.": org.bonitasoft.engine.transaction.STransactionCommitException: PROCESS_DEFINITION_ID=5960294574315284012 | PROCESS_NAME=TIA | PROCESS_VERSION=1.1 | PROCESS_INSTANCE_ID=6455 | ROOT_PROCESS_INSTANCE_ID=6455 | FLOW_NODE_DEFINITION_ID=7657746571431238929 | FLOW_NODE_INSTANCE_ID=569597 | FLOW_NODE_NAME=Finalizar | javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.
	at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.commit(JTATransactionServiceImpl.java:229) [bonita-server-7.1.5.jar:]
	at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.complete(JTATransactionServiceImpl.java:197) [bonita-server-7.1.5.jar:]
	at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:326) [bonita-server-7.1.5.jar:]
	at org.bonitasoft.engine.execution.work.TxBonitaWork.work(TxBonitaWork.java:53) [bonita-server-7.1.5.jar:]
	at org.bonitasoft.engine.execution.work.LockProcessInstanceWork.work(LockProcessInstanceWork.java:79) [bonita-server-7.1.5.jar:]
	at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42) [bonita-server-7.1.5.jar:]
	at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42) [bonita-server-7.1.5.jar:]
	at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42) [bonita-server-7.1.5.jar:]
	at org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork.work(FailureHandlingBonitaWork.java:66) [bonita-server-7.1.5.jar:]
	at org.bonitasoft.engine.work.BonitaWork.run(BonitaWork.java:56) [bonita-server-7.1.5.jar:]
	at org.bonitasoft.engine.work.SequenceRunnableExecutor.innerRun(SequenceRunnableExecutor.java:47) [bonita-server-7.1.5.jar:]
	at org.bonitasoft.engine.work.BonitaRunnable.run(BonitaRunnable.java:35) [bonita-server-7.1.5.jar:]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_79]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_79]
	at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_79]
Caused by: javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.
	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1177)
	at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
	at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
	at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.commit(JTATransactionServiceImpl.java:227) [bonita-server-7.1.5.jar:]
	... 14 more
Caused by: javax.persistence.OptimisticLockException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.most.model.TIA#27142]
	at org.hibernate.ejb.AbstractEntityManagerImpl.wrapStaleStateException(AbstractEntityManagerImpl.java:1413) [hibernate-entitymanager-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1329) [hibernate-entitymanager-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310) [hibernate-entitymanager-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1316) [hibernate-entitymanager-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.ejb.AbstractEntityManagerImpl$CallbackExceptionMapperImpl.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1510) [hibernate-entitymanager-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorNonTrackingImpl.beforeCompletion(SynchronizationCallbackCoordinatorNonTrackingImpl.java:110) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
	at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
	at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
	... 17 more
Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.most.model.TIA#27142]
	at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:2521) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3240) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:3138) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3468) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:140) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:304) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1159) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
	at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorNonTrackingImpl.beforeCompletion(SynchronizationCallbackCoordinatorNonTrackingImpl.java:105) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
	... 23 more

```

---

<div class="post-metadata">

**Author:** ![Sean\_McP](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/sean_mcp/32/932_2.png) [@Sean\_McP](https://community.ofelia.com/u/Sean_McP)\
**Post date:** [5 October 2016 23:00 UTC](https://community.ofelia.com/t/arjuna016053-could-not-commit-transaction/7844/2 "2016-10-05T23:00:46Z")

</div>

Your problem is caused by this:

_Caused by: javax.persistence.OptimisticLockException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.most.model.TIA#27142]_

It looks like another process is updating the BDM in question…

regards  
Seán

PS: While I understand this may not be the answer you are looking for I believe it does answer your question, please mark as resolved by ticking the tick mark on the left of this reply so others now it is closed.

---

<div class="post-metadata">

**Author:** ![awnz](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/awnz/32/1265_2.png) [@awnz](https://community.ofelia.com/u/awnz)\
**Post date:** [12 March 2023 23:20 UTC](https://community.ofelia.com/t/arjuna016053-could-not-commit-transaction/7844/3 "2023-03-12T23:20:39Z")

</div>

In my case, it was caused by a null persistenceVersion value on the affected BDM record.

---

<div class="post-metadata">

**Author:** ![Sean\_McP](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/sean_mcp/32/932_2.png) [@Sean\_McP](https://community.ofelia.com/u/Sean_McP)\
**Post date:** [5 October 2016 22:59 UTC](https://community.ofelia.com/t/arjuna016053-could-not-commit-transaction/7844/4 "2016-10-05T22:59:21Z")

</div>

**A Tip on displaying CODE/LOGS correctly in Posts:**

Do not use the Supplied Buttons above, for some reason they refuse to work correctly, and despite bringing it to Bonitasofts attention, it’s low priority.

_To Show Code/Logs correctly use_

\< code \>  
your code/log  
\< /code \>

removing the spaces to allow the showing of code/logs correctly as here:

`
your code/log
`

Thanks and regards  
Seán

---

<div class="post-metadata">

**Author:** ![vinicius\_8](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@vinicius\_8](https://community.ofelia.com/u/vinicius_8)\
**Post date:** [6 October 2016 12:10 UTC](https://community.ofelia.com/t/arjuna016053-could-not-commit-transaction/7844/5 "2016-10-06T12:10:34Z")

</div>

Thank you Sean, but this is another commom error in bonita that I am having problems.  
When there are some instances of a same process, often occurs this error you mentioned.

```
Caused by: javax.persistence.OptimisticLockException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.most.model.TIA#27142]

```

Did you had this problem too? Do you know what do I need to do to solve it?

Thank you.

---

<div class="post-metadata">

**Author:** ![tony.maluki](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@tony.maluki](https://community.ofelia.com/u/tony.maluki)\
**Post date:** [1 November 2023 09:43 UTC](https://community.ofelia.com/t/arjuna016053-could-not-commit-transaction/7844/6 "2023-11-01T09:43:13Z")

</div>

@awnz you are a life-saver.Thanks

---

<div class="post-metadata">

**Author:** ![awnz](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/awnz/32/1265_2.png) [@awnz](https://community.ofelia.com/u/awnz)\
**Post date:** [28 November 2023 01:09 UTC](https://community.ofelia.com/t/arjuna016053-could-not-commit-transaction/7844/7 "2023-11-28T01:09:03Z")

</div>

Haha, I wondered if there would be any point to answering a seven year old question I stumbled upon when I had this issue!!!  
Glad it helped :)
