Hi all, I'm doing a proof of concept to see if we use Activiti in my company, I use version 5.14 integrated with Spring, Hibernate (with mysql) and Maven. I have problems to managing concurrency, when I try obtain a processInstance using the next method: RuntimeService.startProcessInstanceByKey(…)
The problem is fixed if I make "syncronized" that part of the code. Is it the best way to handle concurrency? is possible to use threads? How could I handle it?
What is actually the problem? Multiple threads can call the startProcessByXXX(..) simultaneously without any issue. They will all start a separate process-instance. Do you want to limit the amount of process-instances started for a process-definition?
My problem happened because the number of database connections was less than the number of threads opened to execute RuntimeService.startProcessInstanceByKey(…). Thanks.