cancel
Showing results for 
Search instead for 
Did you mean: 

Dead locks - jmeter testing with concurrent users

kethur
Champ in-the-making
Champ in-the-making
Hi,

We are using Ms sql server as database.  When running the process with jmeter its throwing the below error.   Not sure what the real issue here is. 

I have read other posts that this kind of problem is resolved in 5.13 but we are on 5.10.  Is there a patch that we could use?

- Database read committed snapshot is on
- single thread works fine.  3 users concurrency has problems
- Dont have any timers in my process but have wait task signals.

IS it something to do with my transaction propagation settings?  I am using spring's default propagation settings.

Thanks,
Raj
——–Error——-
<blockcode>
### Error updating database.  Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 70) 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.TaskEntity.insertTask-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RU_TASK (ID_, REV_, NAME_, PARENT_TASK_ID_, DESCRIPTION_, PRIORITY_, CREATE_TIME_, OWNER_,                       ASSIGNEE_, DELEGATION_, EXECUTION_ID_, PROC_INST_ID_, PROC_DEF_ID_, TASK_DEF_KEY_, DUE_DATE_)     values (?,             1,             ?,             ?,             ?,             ?,             ?,             ?,             ?,             ?,             ?,             ?,             ?,             ?,             ?            )
### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 70) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
   at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:147)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:134)
   at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:459)
   at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:369)
   at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:157)
   at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:109)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49)
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.RuntimeServiceImpl.signal(RuntimeServiceImpl.java:141)
</blockcode>   
2 REPLIES 2

frederikherema1
Star Contributor
Star Contributor
We added some indexes on foreign keys. If these indexes are not present, full-table lock is done on the referenced table when an entity in the parent-table is updated, which causes the deadlocks.

See https://github.com/Activiti/Activiti/commit/22f6c8d0cf126320addb90f86495e89e7d656939 for the involved indexes you can add (double-check if all tables used are present in 5.10)

kethur
Champ in-the-making
Champ in-the-making
Hi,

This is resolved by creating 5.13 indexes in 5.10.  Now, the deadlock is disappeared and works fine.

Many thanks for your help.
Raj