Error while executing parallel multi instance "DELETE VariableInstanceEntity failed"

Oct-2019 11:43:56.180 WARNING [pool-2-thread-1] org.camunda.commons.logging.BaseLogger.logWarn ENGINE-14006 Exception while executing job b8fc7b0e-f71c-11e9-9675-0242ac150002:
org.camunda.bpm.engine.OptimisticLockingException: ENGINE-03005 Execution of ‘DELETE VariableInstanceEntity[abb39aca-f71c-11e9-9675-0242ac150002]’ failed. Entity was updated by another transaction concurrently.
at org.camunda.bpm.engine.impl.db.EnginePersistenceLogger.concurrentUpdateDbEntityException(EnginePersistenceLogger.java:135)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.handleOptimisticLockingException(DbEntityManager.java:499)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperations(DbEntityManager.java:364)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperationManager(DbEntityManager.java:325)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flush(DbEntityManager.java:297)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:208)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.close(CommandContext.java:137)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:116)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:51)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:44)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.executeJob(ExecuteJobsRunnable.java:92)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:61)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Whats the question exactly?

Im getting the above error while performing parallel multi instance.

“: ENGINE-03005 Execution of ‘DELETE VariableInstanceEntity[abb39aca-f71c-11e9-9675-0242ac150002]’ failed. Entity was updated by another transaction concurrently.”

Seems like 2 threads are running, neither blocking.
You might want to read up on optimistic locking

hi,

I have added async before and after at the end event of the parallel instances.

Can you please help me with adding optimistic locking

Upload the model
And i will have a quick look
I hope that will help

hi,
Which bpmn files do you need? the main bpmn and the sub process both?

Give me what you’ve got.

where exactly does the failure happen?

at the CallActivity_parallel. While 2 instances are running parallel and both of them are completing at the same time

Which one specifically.

at this call activity

image

So when each instance returns it overrides the output mapping for the multi-instance and that’s probably causing the problem. It also doesn’t make a lot of sense to have each returning instance overwriting the results of the previous returning instance. Consider using local variables in return and then setting them to the global scope in a new transaction.

do you mean i should remove outmapping varaibles?

Nope, they should be mapped to local variables, which would mean each returning process instance would set the variables to their own variables.

then you would need to add something to set those local variables to the global scope

okay! i ll try this and get back to you. Thanks :smiley:

Thanks this worked.

1 Like