cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti in Tomcat docker container -Issues

amal_v
Champ on-the-rise
Champ on-the-rise

hi all!!

I am a newbie to Activiti

For the past few days i have been trying to set up Activiti in a Tomcat Docker container.My knowledge on the working of activiti and the back-end processes are very limited . But i will try my best to convey my issues.

  • I deployed Activiti in 2 different Tomcat's Docker Containers.

                - Activiti_container1 running on port 8080

                - Activiti_container2 running on port 8081

  • These Activiti's are connected to an Oracle Database and hosts the work-flows of an application.
  • The requests to these containers are distributed via a Load Balancer.
  • Everything works fine except for the components in the application that uses signals.These components triggers heavyweight  processes and requires time to execute and hence uses signals to acknowledge the updates of the action at the front end.

Here is the log I get :

10:25:11,500 [pool-2-thread-1] ERROR org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable - exception during job execution: JobEntity [id=49054095] was updated by another transaction concurrently
org.activiti.engine.ActivitiOptimisticLockingException: JobEntity [id=49054095] was updated by another transaction concurrently
at org.activiti.engine.impl.db.DbSqlSession$CheckedDeleteOperation.execute(DbSqlSession.java:295)
at org.activiti.engine.impl.db.DbSqlSession.flushRegularDeletes(DbSqlSession.java:922)
at org.activiti.engine.impl.db.DbSqlSession.flushDeletes(DbSqlSession.java:888)
at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:613)
at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:212)
at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:138)
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.handleMultipleJobs(ExecuteJobsRunnable.java:94)
at org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
1.517394329435E12

People with more expertise say that it might work fine if there is only one Activiti container.

Can anyone help me solve this issue or help me understand the issue??

Thanks a lot !!

1 ACCEPTED ANSWER

amal_v
Champ on-the-rise
Champ on-the-rise

Ryan Dawson! Thanks a lot for your wonderful support.

I figured out that my problem was not actually associated with Activiti itself.

The actual problem here was that there was a database scheduler in use.

And the docker container's default time zone was set to UTC.

Setting the container time zone to local time zone resolved the issue..

View answer in original post

9 REPLIES 9

ryandawson
Elite Collaborator
Elite Collaborator

I don't think we can know whether you could avoid this issue by running just one Activiti without knowing more about the process definition and what it is doing at the point of failure. It is a likely candidate but it might be possible to produce this error with only one Activiti (see   for example). The best way to find out would probably be to try running just one and see if the problem still occurs.  

amal_v
Champ on-the-rise
Champ on-the-rise

Thanks for replying.

I forgot to mention that it works perfectly fine when Activiti is set up not inside containers.

Two Tomcats running on two different ports with Activiti works fine. This problem occurred only when it was containerized.

ryandawson
Elite Collaborator
Elite Collaborator

Are there any other differences between the dockerised and not dockerised versions? Is more data going into one than the other? Have you increased the memory and CPU defaults for docker? I am wondering if there are either more transactions in the docker version (would happen if more data) or perhaps they are taking longer to complete.

amal_v
Champ on-the-rise
Champ on-the-rise

Found out that the problem occurs even when only single container is used.