cancel
Showing results for 
Search instead for 
Did you mean: 

ORA-01591: lock held by in-doubt distributed transaction

sakumar1
Champ in-the-making
Champ in-the-making
We are using Activiti 5.14, Oracle 11G

Following exception is often coming in System Console ? Can you explain me why this error is coming is this is bug in Activiti ?

### The error may involve org.activiti.engine.impl.persistence.entity.JobEntity.updateTimer-Inline
### The error occurred while setting parameters
### SQL: update ACT_RU_JOB      SET REV_ =  ?,        LOCK_EXP_TIME_ = ?,        LOCK_OWNER_ = ?,        RETRIES_ = ?,        EXCEPTION_STACK_ID_ = ?,        EXCEPTION_MSG_ = ?,        DUEDATE_ = ?      where ID_= ?       and REV_ = ?
### Cause: java.sql.SQLException: ORA-01591: lock held by in-doubt distributed transaction 357.13.52942

        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.AcquireJobsRunnable.run(AcquireJobsRunnable.java:59)
        at java.lang.Thread.run(Thread.java:744)
Caused by: java.sql.SQLException: ORA-01591: lock held by in-doubt distributed transaction 357.13.52942

        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)
        at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:41)
        at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:66)
        at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:45)
        at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:100)
        at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:148)
        … 13 more

Regards,
Sakumar
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
This is the first time in my life i see the 'lock held by in-doubt distributed transaction' exception … no idea really. Which setup is this? JTA? Spring?  But to be honest, not really an idea, given this stacktrace.

sakumar1
Champ in-the-making
Champ in-the-making
We are Using Weblogic  JTA for Transaction Management

trademak
Star Contributor
Star Contributor
With only this stacktrace it's hard to say something about this. Did you try to reproduce it with the latest version of Activiti as well? We added a new type of job executor that's using less locking, so would be good to to see if you see the same errors there.

Best regards,

sakumar1
Champ in-the-making
Champ in-the-making
Thanks for the response. We have upgraded Activiti to 5.17. I will try to see if this issue reproducible in 5.17, will keep you posted on it.

Regards,
Sakumar