Problems with optimistic locking

We are running an instance of Camunda with a Postgres database. We have several parallel tasks running. Each Camunda instance is encapsulated within a docker container. When we run 2 or more containers that point to the same Postgres database we get optimistic locking errors. Sometimes these locks last several seconds before the system can continue processing. Each parallel Camunda task sends JMS messages out to a group of services (a micro service architecture), and when we receive a response back through JMS we signal the Camunda branch to continue where it left off at when we transmitted to JMS. The signal command is where we get most of our optimistic locking issues. This causes the system to slow down tremendously and if we add containers the problem grows exponentially. Has anyone else run into this problem?

@Megabob parallel tasks need to be synchronized at the join parallel gateway.

I thought Camunda automatically tried to synchronized the parallel gateways? Do I overload the Camunda synchronization code by adding a delegate to the join parallel gateway?

@Megabob for synchronization on join gateways you no need to add any code, it’s just configuration in the model by marking the property exclusive:true