# Dead lock while completing a task

**URL:** <https://forum.flowable.org/t/dead-lock-while-completing-a-task/9866>\
**Category:** Flowable Engine\
**Created:** [November 2, 2022, 4:47am UTC](https://forum.flowable.org/t/dead-lock-while-completing-a-task/9866 "2022-11-02T04:47:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ALMATH](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@ALMATH](https://forum.flowable.org/u/ALMATH)\
**Post date:** [November 2, 2022, 4:47am UTC](https://forum.flowable.org/t/dead-lock-while-completing-a-task/9866/1 "2022-11-02T04:47:41Z")

</div>

Hi,

I am getting deadlock error while completing tasks.  
{“timestamp”:1667218964066,“status”:500,“errors”:[{“code”:1003,“value”:“ERR\_INTERNAL\_ERROR”,“message”:“\n### Error querying database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 283) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.\n### The error may exist in org/flowable/variable/service/db/mapping/entity/VariableInstance.xml\n### The error may involve org.flowable.variable.service.impl.persistence.entity.VariableInstanceEntityImpl.selectVariablesByQuery\n### The error occurred while handling results\n### SQL: select \* from ACT\_RU\_VARIABLE WHERE SUB\_SCOPE\_ID\_ = ? AND SCOPE\_TYPE\_ in ( ? )\n### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 283) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.”,“details”:“”}],

This happens while running multiple tasks in parallel with the spring transaction enabled.
