AnsweredAssumed Answered

Calling method: saveModel() of act_re_model, throws ActivitiOptimisticLockingException when called from two different services having different transaction

Question asked by ami on Mar 29, 2017
Latest reply on Apr 4, 2017 by thuynh



Calling method: repositoryService.saveModel() of act_re_model, throws ActivitiOptimisticLockingException when it is called from two different Service layers having different transactions (there is no chance of Transaction being persisted).


I have calls to the method initiated from application to application, hence the previous transaction has to be committed.

But then the second call from application to application, redirected to Service layer and then calling this method, however throws the mentioned exception with below error:-


Optimistic locking exception : org.activiti.engine.ActivitiOptimisticLockingException: org.activiti.engine.impl.persistence.entity.ModelEntity@5c7a4bf8 was updated by another transaction concurrently



I have even tried to use NOT_SUPPORTED Spring propogation annotation on the method that makes first call to the saveModel() method and also REQUIRED and REQUIRES_NEW, but none works.


Even before the second call to saveModel() method, I have ensured that there is no lock acquired on ACT_RE_MODEL by previous databaseTransaction (when I called saveModel() for the first time, the dbTransaction is going to occur).


Any help will be appreciated.



Ami Dave