# Deadlock found when trying to get lock; try restarting transaction

**URL:** <https://forum.flowable.org/t/deadlock-found-when-trying-to-get-lock-try-restarting-transaction/7397>\
**Category:** Flowable Engine\
**Created:** [January 26, 2021, 6:39pm UTC](https://forum.flowable.org/t/deadlock-found-when-trying-to-get-lock-try-restarting-transaction/7397 "2021-01-26T18:39:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jit](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@jit](https://forum.flowable.org/u/jit)\
**Post date:** [January 26, 2021, 6:39pm UTC](https://forum.flowable.org/t/deadlock-found-when-trying-to-get-lock-try-restarting-transaction/7397/1 "2021-01-26T18:39:41Z")

</div>

I am having the exceptions below during the execution of a process and the process terminates after these exceptions. I have changed ISOLATION LEVEL of mysql from REPEATABLE-READ to READ-COMMITTED but I am still having these deadlock exceptions. What else I can do to get rid of from these exceptions.

You can check all exceptions from here.

[https://601062a6dfa9f.htmlsave.net/](https://601062a6dfa9f.htmlsave.net/)

> | ### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction ### The error may exist in org/flowable/variable/service/db/mapping/entity/VariableInstance.xml ### The error may involve org.flowable.variable.service.impl.persistence.entity.VariableInstanceEntityImpl.updateVariableInstance-Inline ### The error occurred while setting parameters ### SQL: update **ACT\_RU\_VARIABLE** SET REV\_ = ?, BYTEARRAY\_ID\_ = ?, LONG\_ = ?, TEXT\_ = ? where ID\_ = ? and REV\_ = ? ### Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction

> | ### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction ### The error may exist in org/flowable/db/mapping/entity/ActivityInstance.xml ### The error may involve org.flowable.engine.impl.persistence.entity.ActivityInstanceEntityImpl.updateActivityInstance-Inline ### The error occurred while setting parameters ### SQL: update **ACT\_RU\_ACTINST** SET REV\_ = ?, PROC\_DEF\_ID\_ = ?, END\_TIME\_ = ?, DURATION\_ = ? where ID\_ = ? and REV\_ = ? ### Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction

> | ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction ### The error may exist in org/flowable/db/mapping/entity/Execution.xml ### The error may involve org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl.updateExecution-Inline ### The error occurred while setting parameters ### SQL: update **ACT\_RU\_EXECUTION** SET REV\_ = ?, ACT\_ID\_ = ? where ID\_ = ? and REV\_ = ? ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [February 8, 2021, 9:13am UTC](https://forum.flowable.org/t/deadlock-found-when-trying-to-get-lock-try-restarting-transaction/7397/2 "2021-02-08T09:13:13Z")

</div>

What setup are you running? Do you have a way we can reproduce ourselves?

Mysql is known to quickly throw deadlocks under load (note that these are not necessarily deadlocks in the true sense of the words - it means that mysql picks a random transaction to roll back).
