<?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 Re: encounter SqlTransactionRollbackException when complete a user task in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/encounter-sqltransactionrollbackexception-when-complete-a-user/m-p/9116#M4117</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for elaborating. Actually I should have also asked about your Activiti setup. It seems like what you're seeing could&amp;nbsp;match to this issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/thread/225442"&gt;deadlocked while deleting records from ACT_RU_EXECUTION with multiple activiti engines running&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Jun 2017 09:37:57 GMT</pubDate>
    <dc:creator>ryandawson</dc:creator>
    <dc:date>2017-06-01T09:37:57Z</dc:date>
    <item>
      <title>encounter SqlTransactionRollbackException when complete a user task</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/encounter-sqltransactionrollbackexception-when-complete-a-user/m-p/9112#M4113</link>
      <description>Hello,&amp;nbsp; &amp;nbsp; i have&amp;nbsp;encountered an exception 'SqlTransactionRollbackException' when i invoked the API 'taskService.complete(Strin taskId,map variables)' to complete a User Task frequently; The probability of encountering this exception is high to 40%.The User Task's property 'asynchronous' is set by 'f</description>
      <pubDate>Sat, 27 May 2017 04:09:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/encounter-sqltransactionrollbackexception-when-complete-a-user/m-p/9112#M4113</guid>
      <dc:creator>karedom</dc:creator>
      <dc:date>2017-05-27T04:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: encounter SqlTransactionRollbackException when complete a user task</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/encounter-sqltransactionrollbackexception-when-complete-a-user/m-p/9113#M4114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you had a look at this forum page -&amp;nbsp;&lt;A class="link-titled" href="http://forums.devshed.com/db2-development-114/deadlock-db2-424840.html" title="http://forums.devshed.com/db2-development-114/deadlock-db2-424840.html" rel="nofollow noopener noreferrer"&gt;Deadlock in DB2&lt;/A&gt;&amp;nbsp;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you could provide a bit more detail or even better a code example that might help. How are you invoking the rest call? Are choosing from a list at random, one at a time or in parallel and at what rate?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 08:49:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/encounter-sqltransactionrollbackexception-when-complete-a-user/m-p/9113#M4114</guid>
      <dc:creator>ryandawson</dc:creator>
      <dc:date>2017-05-30T08:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: encounter SqlTransactionRollbackException when complete a user task</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/encounter-sqltransactionrollbackexception-when-complete-a-user/m-p/9114#M4115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First,thanks for your answer,Ryan!&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I have changed the db2 locktimeout to 60 sec according to the comment &amp;nbsp;on&amp;nbsp;&lt;A class="link-titled" href="http://forums.devshed.com/db2-development-114/deadlock-db2-424840.html" title="http://forums.devshed.com/db2-development-114/deadlock-db2-424840.html" rel="nofollow noopener noreferrer"&gt;Deadlock in DB2&lt;/A&gt;&amp;nbsp;,but it does't work.&lt;/P&gt;&lt;P&gt;my codes as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//1.get task&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TaskEntity task = (TaskEntity) taskService.createTaskQuery().taskId(taskId).singleResult();&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(task==null){&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new TimeException("this task has been finished");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//2.judge if have&amp;nbsp;authority&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;List&amp;lt;IdentityLink&amp;gt; linkList=taskService.getIdentityLinksForTask(taskId);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;boolean haveNotRight=true;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if(linkList!=null){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for(IdentityLink link:linkList){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(approveUserId.equals(link.getUserId())){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; haveNotRight=false;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(haveNotRight){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;throw new RunTimeException("no authority");&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; //3.get activiti variables map&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Map&amp;lt;String, Object&amp;gt; variables =taskService.getTaskVariablesByTaskId(taskId);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ShareVO afterShareMain=(ShareVO)variables.get("afterShareMain");&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String serviceDataOfOrgCode=(String)variables.get("serviceDataOfOrgCode");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //this api is to judge if the same net &amp;nbsp;base on the datas from db2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Map&amp;lt;String,Object&amp;gt; isSame=this.isSameOrg(afterShareMain, serviceDataOfOrgCode);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; int isSameNet="1".equals(isSame.get("isSameNet"))?1:0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;//4.put the parameter into the variables map&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; variables.put("result", Integer.parseInt(result));&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;variables.put("comments", comments);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;variables.put("approveUserId", approveUserId);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt; variables.put("isSameNet",isSameNet);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; //5. set local &amp;nbsp;variable&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;taskService.setVariablesLocal(taskId, variables);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; //6.complete the task&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &lt;SPAN&gt;&amp;nbsp;taskService&lt;/SPAN&gt;.completeTask(taskId, variables);&lt;/P&gt;&lt;P&gt;Besides,i have used a TaskListener when create this &amp;nbsp;UserTask(or act node),the TaskListener is to add candidate user to the UserTask( invoke the API 'DelegateTask.addCandidateUsers(String userId)').&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;by the way,encouting the&amp;nbsp;&lt;SPAN style="color: #727174; background-color: #ffffff; font-size: 14px;"&gt;SqlTransactionRollbackException always happened when the number of visiting our soft web is higher.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jun 2017 09:00:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/encounter-sqltransactionrollbackexception-when-complete-a-user/m-p/9114#M4115</guid>
      <dc:creator>karedom</dc:creator>
      <dc:date>2017-06-01T09:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: encounter SqlTransactionRollbackException when complete a user task</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/encounter-sqltransactionrollbackexception-when-complete-a-user/m-p/9115#M4116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;forget your question &lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;ne at a time , not&amp;nbsp;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;in parallel! Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jun 2017 09:06:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/encounter-sqltransactionrollbackexception-when-complete-a-user/m-p/9115#M4116</guid>
      <dc:creator>karedom</dc:creator>
      <dc:date>2017-06-01T09:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: encounter SqlTransactionRollbackException when complete a user task</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/encounter-sqltransactionrollbackexception-when-complete-a-user/m-p/9116#M4117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for elaborating. Actually I should have also asked about your Activiti setup. It seems like what you're seeing could&amp;nbsp;match to this issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/thread/225442"&gt;deadlocked while deleting records from ACT_RU_EXECUTION with multiple activiti engines running&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jun 2017 09:37:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/encounter-sqltransactionrollbackexception-when-complete-a-user/m-p/9116#M4117</guid>
      <dc:creator>ryandawson</dc:creator>
      <dc:date>2017-06-01T09:37:57Z</dc:date>
    </item>
  </channel>
</rss>

