We have used Activiti framework version 5.15 and we are getting concurrent modification issue for job execution.

also mentioned error stack trace

```
2018-09-19 16:13:46,083 ERROR [org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable] (pool-4-thread-30) exception during job execution: ProcessInstance[34391064] was updated by another transaction concurrently: org.activiti.engine.ActivitiOptimisticLockingException: ProcessInstance[34391064] was updated by another transaction concurrently
at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:622)
at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:503)
at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:182)
at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:128)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:66)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
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:52)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

```

We have fix this issue with hazelcast locking mechanisum into processInstanceId because it is unique during hole workflow execution.

We have taken hazelcast lock when activiti begin transaction(\*\*in ExecuteJobCommand.java before job.execute(commandContext); \*\*) for executing service task, And release this lock when activiti commit transaction (for service task) in CommandContext.java after transactionContext.commit();

Using this mechanisum we had solve issue(concurrent modification exception).

I need some suggestion that it will create any problem in production for job execution? 
and suggest that if anyone have another solution for solving this issue.