cancel
Showing results for 
Search instead for 
Did you mean: 

Dead Lock Observed in Activiti Queries

sakumar1
Champ in-the-making
Champ in-the-making
Hi,

Some times we are observing following Activiti dead lock SQL traces in our setup, Not sure How to reproduce this issue . Did any one observe the same issue in your setup ?

Feb 25, 2015 1:13:05 PM org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: java.sql.SQLException: ORA-00060: deadlock detected while waiting for resource

### The error may involve org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity.updateHistoricActivityInstance-Inline
### The error occurred while setting parameters
### SQL: update ACT_HI_ACTINST set       EXECUTION_ID_ = ?,       ASSIGNEE_ = ?,       END_TIME_ = ?,       DURATION_ = ?     where ID_ = ?
### Cause: java.sql.SQLException: ORA-00060: deadlock detected while waiting for resource

        at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:150)
        at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:560)
        at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:444)
        at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:170)
        at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:117)
        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:131)
        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:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)
Caused by: java.sql.SQLException: ORA-00060: deadlock detected while waiting for resource

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
        at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1044)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3594)
        at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3695)
        at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1378)
        at weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:101)
2 REPLIES 2

trademak
Star Contributor
Star Contributor
Hi,

Which version of Activiti are you using?
Do you have a lot of automatic activities in your process like a lot of synchronous service tasks? When the Activiti transaction is running a number of seconds, deadlocks are more likely to occur. So asynchronous jobs could improve this.

Best regards,

himanshu_agarwa
Champ in-the-making
Champ in-the-making
Hi Rademakers,

I am also having the same deadlock issue while completing a user task, I haven't marked any service task as async for now but the concern is that the transaction is completed once user is completing the task and complete task api is called than also why we get this error.

I had added a detailed note here
https://forums.activiti.org/content/dont-allow-same-task-be-completed-different-user-same-time

Glad to hear from you ASAP.

-Himanshu