AnsweredAssumed Answered

Activiti deadlock occurs under JMeter performance test

Question asked by lepike on Jul 12, 2011
Latest reply on Jul 3, 2013 by frederikheremans1
Hi Guys!

One of my project uses Activiti Workflow Engine. The usage of the engine is very comfortable and I'm very satisfied with it, but I have a little problem with concurrency. We have a wicket spring application with embedded activiti workflow engine. It works fine without concurrent users, but during jmeter performance test activiti creates deadlock on its own tables. For example: ACT_RU_JOB, ACT_RU_EXECUTION, ACT_RU_VARIABLE. I've found a thread here (http://forums.activiti.org/en/viewtopic.php?f=6&t=682&start=0) that suggests using queues to start activiti processes. This solution didn't solve the problem, because deadlocks still occuring. I provide some configuration and stacktrace for you.
All answers can be useful for me.

my activiti configuration:

  
 <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
          <property name="databaseType" value="mssql" />
          <property name="dataSource" ref="dataSource" />
          <property name="transactionManager" ref="transactionManagerLugy" />
          <property name="databaseSchemaUpdate" value="true" />
          <property name="jobExecutorActivate" value="true" />
          <property name="deploymentResources" value="classpath*:/diagrams/idm/*.bpmn20.xml" />    
          <property name="history" value="none"/>      
          <property name="jdbcMaxActiveConnections" value="1000"/>
          <property name="jdbcMaxIdleConnections" value="10"/>
          <property name="jdbcMaxWaitTime" value="50000"/>
       </bean>   
       
   
       <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
          <property name="processEngineConfiguration" ref="processEngineConfiguration" />
       </bean>

stacktrace:

    ### Error querying database.  Cause: org.hibernate.exception.LockAcquisitionException: Transaction (Process ID 67) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
    ### The error may involve org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.selectVariablesByExecutionId-Inline
    ### The error occurred while setting parameters
    ### Cause: org.hibernate.exception.LockAcquisitionException: Transaction (Process ID 67) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
       at org.springframework.jms.listener.adapter.MessageListenerAdapter.invokeListenerMethod(MessageListenerAdapter.java:471)
       at org.springframework.jms.listener.adapter.MessageListenerAdapter.onMessage(MessageListenerAdapter.java:355)
       at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:535)
       at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:495)
       at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)
       at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
       at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
       at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)
       at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)
       at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)
       at java.lang.Thread.run(Thread.java:662)

Thanks for the help!

Levi

Outcomes