AnsweredAssumed Answered

Async Continuations with concurrent executions

Question asked by meyerd on Nov 2, 2011
Latest reply on May 22, 2013 by jdev.hari

The underlying problem is that in the case of the process shown in the linked forum post, we have one root execution and 3 concurrent child executions. The child executions are continued asynchronously in three different transactions. When reaching the joining gateway, each transaction sets the property ExecutionEntity.forceUpdate=true on the parent execution. While this is not a persistent property, it nevertheless forces a new version of the parent execution to be committed hence the OptimisticLockingException.

This is totally fine from an engine/persistence point of view but maybe not what the user expects.
We can think about how to deal with this:
- simply accept it :)  or
- implement exclusive jobs (some hooks in the code and database schema already there)

I noticed that optimistic concurrency control is not something people seem to "get". We currently have a lot of forum threads/jiras concerning some instance of this. Maybe the job executor should do things "pessimistically" by default (exclusive jobs would be the default behavior and if you know what you are doing you can use sth. like activiti:exclusive="false" in order to enhance performance) ?