# PersistenceException with Deadlock error

**URL:** <https://forum.flowable.org/t/persistenceexception-with-deadlock-error/10654>\
**Category:** Uncategorized\
**Created:** [June 30, 2023, 12:20am UTC](https://forum.flowable.org/t/persistenceexception-with-deadlock-error/10654 "2023-06-30T00:20:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Venkata](https://avatars.discourse-cdn.com/v4/letter/v/f4b2a3/32.png) [@Venkata](https://forum.flowable.org/u/Venkata)\
**Post date:** [June 30, 2023, 12:20am UTC](https://forum.flowable.org/t/persistenceexception-with-deadlock-error/10654/1 "2023-06-30T00:20:31Z")

</div>

How to deal with Persistence Exception.  
We are having couple of http tasks and this error coming when are having some load (50 startprocess instance calls in 3 mins time.  
org.apache.ibatis.exceptions.PersistenceException:

### Error querying database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 93) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

### The error may exist in org/flowable/db/mapping/entity/Execution.xml

### The error may involve org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl.selectSubProcessInstanceBySuperExecutionId

### The error occurred while handling results

### SQL: select \* from ACT\_RU\_EXECUTION where SUPER\_EXEC\_ = ?

### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 93) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[mybatis-3.5.7.jar!/:3.5.7]  
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:153) ~[mybatis-3.5.7.jar!/:3.5.7]  
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:145) ~[mybatis-3.5.7.jar!/:3.5.7]  
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) ~[mybatis-3.5.7.jar!/:3.5.7]  
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:76) ~[mybatis-3.5.7.jar!/:3.5.7]  
at org.flowable.common.engine.impl.db.DbSqlSession.selectOne(DbSqlSession.java:281) ~[flowable-engine-common-6.7.2.jar!/:6.7.2]  
at org.flowable.common.engine.impl.db.AbstractDataManager.getEntity(AbstractDataManager.java:123) ~[flowable-engine-common-6.7.2.jar!/:6.7.2

---

<div class="post-metadata">

**Author:** ![Venkata](https://avatars.discourse-cdn.com/v4/letter/v/f4b2a3/32.png) [@Venkata](https://forum.flowable.org/u/Venkata)\
**Post date:** [July 12, 2023, 10:31pm UTC](https://forum.flowable.org/t/persistenceexception-with-deadlock-error/10654/2 "2023-07-12T22:31:41Z")

</div>

Can some respond on this. This is failing when running multiple transactions at time and coming intermittently.
