Activiti hanging waiting for next Id.

cancel
Showing results for 
Search instead for 
Did you mean: 
mprakash
Active Member II

Activiti hanging waiting for next Id.

Jump to solution

We are seeing a problem with the Activiti engine hanging in an apparent deadlock.

We have deployed Activiti 5.22.0 in Tomcat, and using C3P0 connection pool. If we set Tomcat thread pool size to be equal to or greater than the connection pool size, the entire system hangs, apparently waiting to get the next id from the DB. Below is the relevant section of the thread dump. Each thread seems to be stuck in the same place.

Any ideas? Should the thread pool always be smaller than the connection pool?

Thanks.


"http-nio-8080-exec-20" #45 daemon prio=5 os_prio=0 tid=0x00007f2b7c020800 nid=0x2694 waiting for monitor entry [0x00007f2bee15c000]
java.lang.Thread.State: BLOCKED (on object monitor)
at org.activiti.engine.impl.db.DbIdGenerator.getNextId(DbIdGenerator.java:35)
- waiting to lock <0x00000006c1f952d8> (a org.activiti.engine.impl.db.DbIdGenerator)
at org.activiti.engine.impl.db.DbSqlSession.insert(DbSqlSession.java:151)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.insert(ExecutionEntity.java:1270)
at org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity.newProcessInstance(ProcessDefinitionEntity.java:146)
at org.activiti.engine.impl.pvm.process.ProcessDefinitionImpl.createProcessInstanceForInitial(ProcessDefinitionImpl.java:63)
at org.activiti.engine.impl.pvm.process.ProcessDefinitionImpl.createProcessInstance(ProcessDefinitionImpl.java:53)
at org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity.createProcessInstance(ProcessDefinitionEntity.java:87)
at org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity.createProcessInstance(ProcessDefinitionEntity.java:135)
at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:99)
at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:37)
at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
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.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:86)
at org.activiti.rest.service.api.runtime.process.ProcessInstanceCollectionResource.createProcessInstance(ProcessInstanceCollectionResource.java:166)


1 Solution

Accepted Solutions
gdharley
Intermediate

Re: Activiti hanging waiting for next Id.

Jump to solution

Use the strongUUid generator. It does not utilize the database, is more performant and is a much better option for production environments.

Greg

View solution in original post

2 Replies
gdharley
Intermediate

Re: Activiti hanging waiting for next Id.

Jump to solution

Use the strongUUid generator. It does not utilize the database, is more performant and is a much better option for production environments.

Greg

mprakash
Active Member II

Re: Activiti hanging waiting for next Id.

Jump to solution

Thanks for the pointer. Will give it a try.

Mayank.