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