<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Deadlock on AcquireAsyncJobsDueCmd for MSSQL in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/deadlock-on-acquireasyncjobsduecmd-for-mssql/m-p/31218#M13234</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using activiti in one of my project. I am using 5.22.0 version of activiti. I am using sprint boot in my application. My activiti engine is using MSSQL.&lt;/P&gt;&lt;P&gt;Whenever I do a performance test of my application I see the following error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;### SQL: SELECT SUB.* FROM ( &amp;nbsp; &amp;nbsp; select&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RES.* , row_number() over (ORDER BY RES.ID_ asc) rnk FROM ( select distinct RES.* &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; from ACT_RU_JOB RES &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LEFT OUTER JOIN ACT_RU_EXECUTION PI ON PI.ID_ = RES.PROCESS_INSTANCE_ID_ &amp;nbsp; &amp;nbsp; where RES.RETRIES_ &amp;gt; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; and (&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (RES.DUEDATE_ is not null and RES.DUEDATE_ &amp;lt;= ? and RES.LOCK_EXP_TIME_ is null) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; or&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (RES.LOCK_EXP_TIME_ is not null and RES.LOCK_EXP_TIME_ &amp;lt;= ?) &amp;nbsp; &amp;nbsp; &amp;nbsp; ) &amp;nbsp; &amp;nbsp; &amp;nbsp; and TYPE_ = 'message' &amp;nbsp; &amp;nbsp; &amp;nbsp; and ( &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (RES.EXECUTION_ID_ is null) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; or&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (PI.SUSPENSION_STATE_ = 1) &amp;nbsp; &amp;nbsp; &amp;nbsp; ) &amp;nbsp; &amp;nbsp; &amp;nbsp; )RES ) SUB WHERE SUB.rnk &amp;gt;= ? AND SUB.rnk &amp;lt; ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 171) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;org.apache.ibatis.exceptions.PersistenceException: &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;### Error querying database.&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 171) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;### The error may exist in org/activiti/db/mapping/entity/Job.xml&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;### The error may involve org.activiti.engine.impl.persistence.entity.JobEntity.selectAsyncJobsDueToExecute&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;### The error occurred while handling results&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;### SQL: SELECT SUB.* FROM ( &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;select&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;RES.* , row_number() over (ORDER BY RES.ID_ asc) rnk FROM ( select distinct RES.* &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;from ACT_RU_JOB RES &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;LEFT OUTER JOIN ACT_RU_EXECUTION PI ON PI.ID_ = RES.PROCESS_INSTANCE_ID_ &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;where RES.RETRIES_ &amp;gt; 0&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;and (&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;(RES.DUEDATE_ is not null and RES.DUEDATE_ &amp;lt;= ? and RES.LOCK_EXP_TIME_ is null) &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;or&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;(RES.LOCK_EXP_TIME_ is not null and RES.LOCK_EXP_TIME_ &amp;lt;= ?) &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;) &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;and TYPE_ = 'message' &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;and ( &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;(RES.EXECUTION_ID_ is null) &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;or&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;(PI.SUSPENSION_STATE_ = 1) &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;) &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;)RES ) SUB WHERE SUB.rnk &amp;gt;= ? AND SUB.rnk &amp;lt; ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 171) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:122)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:113)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.activiti.engine.impl.db.DbSqlSession.selectListWithRawParameter(DbSqlSession.java:440)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:431)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:426)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:409)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.activiti.engine.impl.persistence.entity.JobEntityManager.findAsyncJobsDueToExecute(JobEntityManager.java:164)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.activiti.engine.impl.cmd.AcquireAsyncJobsDueCmd.execute(AcquireAsyncJobsDueCmd.java:42)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.activiti.engine.impl.cmd.AcquireAsyncJobsDueCmd.execute(AcquireAsyncJobsDueCmd.java:30)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.activiti.engine.impl.asyncexecutor.AcquireAsyncJobsDueRunnable.run(AcquireAsyncJobsDueRunnable.java:52)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at java.lang.Thread.run(Thread.java:745)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 171) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at com.microsoft.sqlserver.jdbc.SQLServerResultSet$FetchBuffer.nextRow(SQLServerResultSet.java:4853)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at com.microsoft.sqlserver.jdbc.SQLServerResultSet.fetchBufferNext(SQLServerResultSet.java:1781)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at com.microsoft.sqlserver.jdbc.SQLServerResultSet.next(SQLServerResultSet.java:1034)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValuesForSimpleResultMap(DefaultResultSetHandler.java:296)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValues(DefaultResultSetHandler.java:273)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSet(DefaultResultSetHandler.java:246)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSets(DefaultResultSetHandler.java:160)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:78)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:303)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:154)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:102)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:82)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:120)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;... 18 common frames omitted&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Can someone help here? What do you think I am doing wrong? Have you seen this error before?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 May 2017 12:10:58 GMT</pubDate>
    <dc:creator>saurabh_biet</dc:creator>
    <dc:date>2017-05-10T12:10:58Z</dc:date>
    <item>
      <title>Deadlock on AcquireAsyncJobsDueCmd for MSSQL</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/deadlock-on-acquireasyncjobsduecmd-for-mssql/m-p/31218#M13234</link>
      <description>Hi There,I am using activiti in one of my project. I am using 5.22.0 version of activiti. I am using sprint boot in my application. My activiti engine is using MSSQL.Whenever I do a performance test of my application I see the following error:### SQL: SELECT SUB.* FROM ( &amp;nbsp; &amp;nbsp; select&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RES.* , ro</description>
      <pubDate>Wed, 10 May 2017 12:10:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/deadlock-on-acquireasyncjobsduecmd-for-mssql/m-p/31218#M13234</guid>
      <dc:creator>saurabh_biet</dc:creator>
      <dc:date>2017-05-10T12:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Deadlock on AcquireAsyncJobsDueCmd for MSSQL</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/deadlock-on-acquireasyncjobsduecmd-for-mssql/m-p/31219#M13235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even when READ_COMMITTED_SNAPSHOT option(SQL Server's database option) is enabled, are deadlocks reproduced?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can change READ_COMMITTED_SNAPSHOT option by the following sql.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;ALTER DATABASE {data_base_name} SET READ_COMMITTED_SNAPSHOT ON;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;* If you want to know detail, you should check the MS's site.&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://msdn.microsoft.com/en-us//library/tcbchxcb(v=vs.110).aspx" rel="nofollow noopener noreferrer" target="_blank"&gt;https://msdn.microsoft.com/en-us//library/tcbchxcb(v=vs.110).aspx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Similar problem&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://github.com/Activiti/Activiti/issues/1083" rel="nofollow noopener noreferrer" target="_blank"&gt;https://github.com/Activiti/Activiti/issues/1083&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 May 2017 12:27:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/deadlock-on-acquireasyncjobsduecmd-for-mssql/m-p/31219#M13235</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-10T12:27:00Z</dc:date>
    </item>
  </channel>
</rss>

