VERIFIED SOLUTION i

Deadlock error in EngageOne Server

Software Affected: EngageOne Server
 

Issue

The following is the deadlock error in the EngageOne Server logs:
### Error querying database.  Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 275) 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/activiti/db/mapping/entity/Task.xml
### The error may involve org.activiti.engine.impl.persistence.entity.TaskEntity.selectTaskWithVariablesByQueryCriteria_mssql_or_db2-Inline
### The error occurred while setting parameters
...
### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 275) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
    

Cause

The deadlock issue is Activiti (and Camunda - Activiti fork) engine issue.

Resolution

UPDATED: July 2, 2019
This can be fixed by Activiti database tuning.
Enable Row Versioning-Based Isolation Levels by setting:
ALTER DATABASE activiti SET READ_COMMITTED_SNAPSHOT ON
Here are details:
https://stackoverflow.com/questions/43256607/activiti-deadlocks-occuring-with-queries-on-tables-task-execution-and-procd/43268030?noredirect=1#comment73612408_43268030

https://app.camunda.com/jira/si/jira.issueviews:issue-html/CAM-1646/CAM-1646.html