AnsweredAssumed Answered

async parallel/inclusive gateways

Question asked by rickm on Nov 11, 2014
Latest reply on Nov 20, 2014 by jbarrez
Hi,

I recently saw in a posting on Tijs' blog (http://bpmn20inaction.blogspot.com/2014/07/activiti-516-feature-preview.html) that the solution for joining of parallel/inclusive gateways had been cleaned up in 5.16 so that it was not necessary to use external frameworks to address the issue of optimistic locks.   This all looks great, but I can't seem to get it to work, I'm still seeing the ActivitiOptimisticLockingException. 

TIA,
Rick

My environment is:
- Activiti 5.16.4
- JRE 1.7
- Tomcat 8.0
- Eclipse Luna
- H2

Below is the content of my source:

BPMN definition attached.

Task_Test.java:
package tasks;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;


public class Task_Test implements JavaDelegate {

   @Override
   public void execute(DelegateExecution context) throws Exception {
      System.out.println("Executing activity: " + context.getCurrentActivityName());
      
      Thread.sleep(100);
   }
}

Console:
Starting Process ID Process2
Executing activity: Task 1
Executing activity: Task 2
Exception in thread "pool-1-thread-2" org.activiti.engine.ActivitiOptimisticLockingException: ProcessInstance[8505] was updated by another transaction concurrently
   at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:562)
   at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:444)
   at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:170)
   at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:117)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:66)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
   at org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:46)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:745)

Attachments

Outcomes