Getting org.camunda.bpm.engine.OptimisticLockingException


#1

Hi Team,

We are using Camunda 7.6.2.

Am getting org.camunda.bpm.engine.OptimisticLockingException.

FYI:
Dec 04, 2017 8:32:29 AM org.camunda.commons.logging.BaseLogger logWarn
WARNING: ENGINE-14006 Exception while executing job 92093c95-d8f7-11e7-ae35-005056b1183b:
org.camunda.bpm.engine.OptimisticLockingException: ENGINE-03005 Execution of ‘DELETE MessageEntity[92093c95-d8f7-11e7-ae35-005056b1183b]’ failed. Entity was updated by another transaction concurrently.
at org.camunda.bpm.engine.impl.db.EnginePersistenceLogger.concurrentUpdateDbEntityException(EnginePersistenceLogger.java:125)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.handleOptimisticLockingException(DbEntityManager.java:342)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperationManager(DbEntityManager.java:308)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flush(DbEntityManager.java:281)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:247)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.close(CommandContext.java:176)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:113)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)

Could you please help us how to over come this.

Thanks,
Sudhanshu


#2

Hi Sudhanshu,

You can read about optimistic locking and situations provoking OptimisticLockingException here: https://docs.camunda.org/manual/7.8/user-guide/process-engine/transactions-in-processes/#optimistic-locking

In order to understand why you see the exception in your particular case, you have to assess

  • the process model
  • the state of the process instance when the exception occurs
  • the parallel, overlapping transactions that could cause the conflict

If you need help with that, please post the above data here.

Cheers,
Thorben