ENGINE-03005 Execution of 'DELETE TimerEntity[d048352b-c602-11ec-b13b-00ff8136e8e3]' failed. Entity was updated by another transaction concurrently."

Hi Team,

Greetings,

I have configured my BPMN with timer events , I have deployed the designs in platform .But when I start my corresponding services the existing process instances gets started automatically .I’m unable to delete the process Instance .So i tried to delete the deployment ,But that is also not possible .Getting the below exception.

“ENGINE-03005 Execution of ‘DELETE TimerEntity[d048352b-c602-11ec-b13b-00ff8136e8e3]’ failed. Entity was updated by another transaction concurrently.”

I’m getting this error and I’m unable to delete them.
Order_MOCK_ERP_flow.bpmn (135.0 KB)
//delete deployments
DeploymentQuery deploymentQuery = processEngine.getRepositoryService().createDeploymentQuery();
List deployments = deploymentQuery.list();
for (Deployment deployment : deployments) {
// processEngine.getRepositoryService().deleteDeployment(deployment.getId());

    }

//delete process Instance
ProcessInstanceQuery query=runtimeService.createProcessInstanceQuery().processDefinitionKey(“Order_MOCK_erp_flow”);
List processInstanceList=query.list();
for (ProcessInstance processInstance : processInstanceList){
String processInstanceId=processInstance.getProcessInstanceId();
// runtimeService.deleteProcessInstanceIfExists(processInstance.getProcessInstanceId(), “”, true, true, true, true);
runtimeService.deleteProcessInstance(processInstanceId,“Unwanted”);
// camundaFeignClient.deleteProcessInstance(processInstanceId);
}
Kindly provide me a way to fix the issue.

Thanks in advance .

Hello @Aravint_Aspire ,

I see that you are using timer events to trigger a retry.

This can also be achieved by using the engine-native retry mechanism and will save you from a lot of clutter in the process model.

Are you aware of these mechanisms and if yes, is there a reason why you refuse to use them?

Jonathan

Hi @jonathan.lukas ,

Greetings,

No , I wasn’t aware of engine-native retry mechanism .so I throw directly from the service task and based on success or failure the intermediate catch event triggers.But now when I start the server ,The process instance also gets resumed and its running endlessly .Could you please provide a solution to stop the process Instances or the deployments made for that bpmn .

Hello @Aravint_Aspire ,

I cannot follow you now. What do you throw and where is it caught?

Jonathan

Hi @jonathan.lukas ,

The service task is an API in certain microservice ,If any error occurs and we get other than 200 asHttpStatus that XOR will be activated and the timer containg flow will be executed as per design .If we get 200 then success flow will be happening and the flow will be ended.

The issue here is the APIs are getting executed continously whenver I start the corresponding microservice .I want to stop or delete the running instances and the definitions if possible .If i was able to delete them then the issue will be cleared and I will do changes from Design wise and API wise for stablility .
As camunda cockpit/tasklist id also not able to access in chrome ,after I enter the username and password ,Main page opens and when I hit cockpit Its not opening its still loading .

Hello @Aravint_Aspire ,

as this is a local setup, just drop the database.
To have a better reproduction of your problems, you can also write a Unit Test.

Jonathan

HI @jonathan.lukas ,

Im working on unit testing , But my doubt here is a process Instance needs to be deleted,I tried this REST call ,I got many running instances ,
http://localhost:8174/engine-rest/process-instance
{
“links”: [],
“id”: “ee0e86b3-c569-11ec-a21d-00ff8136e8e3”,
“definitionId”: “Order_MOCK_erp_flow:10:cc4933bf-c569-11ec-a21d-00ff8136e8e3”,
“businessKey”: null,
“caseInstanceId”: null,
“ended”: false,
“suspended”: false,
“tenantId”: null
}

but when I try to delete them or end or suspend , I got the error “ENGINE-03005 Execution of ‘DELETE TimerEntity[d048352b-c602-11ec-b13b-00ff8136e8e3]’ failed. Entity was updated by another transaction concurrently."

Any possible way to delete them .

Hello @Aravint_Aspire ,

is it possible that you have a „live lock“ at some point in your process? Meaning something is constantly executed. A hot candidate are the loops with the timer. Is there a timer set to 0 seconds?

Jonathan

Hi @jonathan.lukas ,

There are no locks specified and also I specified all the timers with minimum PT10S and PT30S ,PT2M .Only used these three .Whether can a design have both intermediate timer event and Timer Interrupting start event inside a event sub process ??

Because as you can see,I have two timers ,But in the active process Instance list Im able to get only one which is timer_construct .

test_construct_assign.bpmn (12.9 KB)

http://localhost:8174/engine-rest/process-instance/912ca597-c7ab-11ec-a5b8-00ff8136e8e3/activity-instances
RES :
{
“id”: “912ca597-c7ab-11ec-a5b8-00ff8136e8e3”,
“parentActivityInstanceId”: null,
“activityId”: “test_construct_assign:10:5672ecca-c7ab-11ec-a5b8-00ff8136e8e3”,
“activityType”: “processDefinition”,
“processInstanceId”: “912ca597-c7ab-11ec-a5b8-00ff8136e8e3”,
“processDefinitionId”: “test_construct_assign:10:5672ecca-c7ab-11ec-a5b8-00ff8136e8e3”,
“childActivityInstances”: [
{
“id”: “Timer_construct:b2a056bb-c7ab-11ec-9f71-00ff03f53561”,
“parentActivityInstanceId”: “912ca597-c7ab-11ec-a5b8-00ff8136e8e3”,
“activityId”: “Timer_construct”,
“activityType”: “intermediateTimer”,
“processInstanceId”: “912ca597-c7ab-11ec-a5b8-00ff8136e8e3”,
“processDefinitionId”: “test_construct_assign:10:5672ecca-c7ab-11ec-a5b8-00ff8136e8e3”,
“childActivityInstances”: [],
“childTransitionInstances”: [],
“executionIds”: [
“b2a056ba-c7ab-11ec-9f71-00ff03f53561”
],
“activityName”: “Timer_construct”,
“incidentIds”: [],
“incidents”: [],
“name”: “Timer_construct”
}
],
“childTransitionInstances”: [],
“executionIds”: [
“912ca597-c7ab-11ec-a5b8-00ff8136e8e3”
],

"activityName": null,
"incidentIds": [],
"incidents": [],
"name": null

}

Please let me know why the timer in subprocess is not in active state ?

Thanks,
Aravint