Calling method: saveModel() of act_re_model, throws ActivitiOptimisticLockingException when called from two different services having different transaction
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).
Re: Calling method: saveModel() of act_re_model, throws ActivitiOptimisticLockingException when called from two different services having different transaction
Our current Activiti Framework Version is 5.15
Actually I feel it is easy to detremine that if I make a server-to-server (application-to-application) call then previous Transaction has to be committed. And I can see the changes in database tables, even I can't find any table is still locked after first call.
Hence there is some issue from Activiti itself that it isn't committing the previous transaction of saveModel somwhow, I have tried to put delay of 3mins as well once first call is back to the initiator server, but still getting same Exception on second call to saveModel.