<?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: Back to back Service task doesn't work in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29869#M12715</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the stated solution, but didn't worked. Still getting&amp;nbsp;ActivitiOptimisticLockingException.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ami&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 May 2017 12:54:38 GMT</pubDate>
    <dc:creator>ami</dc:creator>
    <dc:date>2017-05-11T12:54:38Z</dc:date>
    <item>
      <title>Back to back Service task doesn't work</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29863#M12709</link>
      <description>Hi,We have a design like One Service Task is followed by next Service Task. Here it throws below error when the second Service task is initiated:2017-05-09 15:50:16,341 DEBUG [org.activiti.engine.impl.db.DbSqlSession] (pool-5-thread-2) executing: delete ConcurrentExecution[2119210]2017-05-09 15:50:1</description>
      <pubDate>Tue, 09 May 2017 13:27:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29863#M12709</guid>
      <dc:creator>ami</dc:creator>
      <dc:date>2017-05-09T13:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Back to back Service task doesn't work</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29864#M12710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ami,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you always get this error "&lt;SPAN&gt;ActivitiOptimisticLockingException&lt;/SPAN&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;"&amp;nbsp;&lt;/SPAN&gt;from the second service task? Is it easy to reproduce this error in a unit test and share it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ciju&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2017 23:55:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29864#M12710</guid>
      <dc:creator>cjose</dc:creator>
      <dc:date>2017-05-09T23:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Back to back Service task doesn't work</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29865#M12711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ciju,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for reply. I am always persistently getting the same exception all the time when second Service task tried to update in activiti db, and during that I don't whom's but some other task's transaction is updating in db(whose transaction might not be yet committed).&lt;/P&gt;&lt;P&gt;Scenario is like, out of 10, one Design is stuck at the second service task, due to this issue, all 9 gets completed successfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For User task, we call TaskService.complete method to complete the user task which initiates the flow of Service task, So I doubt that the complete method of Activiti's class-TaskService, might return back the call without committing the transaction. Is it so?&amp;nbsp;&lt;/P&gt;&lt;P&gt;QUESTION:Then how can I ensure that the transaction of user task is committed or not?which class should I use for that assurance?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because I'm damn sure for Service task, we ensure that afterCommit() method is used and then next waiting task gets lock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would not be easy to create Unit test for whole Design that I have shared in the image attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ami&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 May 2017 06:03:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29865#M12711</guid>
      <dc:creator>ami</dc:creator>
      <dc:date>2017-05-10T06:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Back to back Service task doesn't work</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29866#M12712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you attempted to make the second service task "asynchronous".&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should push it onto the job queue which will permit the original thread to release and commit the transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pretty standard issue, optimistic locking issues should be resolved in the version 6 engine (that was a design goal).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 May 2017 13:36:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29866#M12712</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-05-10T13:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Back to back Service task doesn't work</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29867#M12713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By default our all service tasks are "&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;asynchronous&lt;/SPAN&gt;" and hence both gets pushed into job queue.&lt;BR /&gt;So do you think we need to make any changes out here to make this scenario work?&lt;/P&gt;&lt;P&gt;Suggest me some approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ami&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 May 2017 13:46:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29867#M12713</guid>
      <dc:creator>ami</dc:creator>
      <dc:date>2017-05-10T13:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Back to back Service task doesn't work</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29868#M12714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, so I can't be certain without seeing a thread dump but it's possible that with both service tasks on the queue they are being picked up&amp;nbsp;in the same scheduler "scan" and so the services are being completed at the same time.&lt;/P&gt;&lt;P&gt;Just for testing purposes and to see if behavior changes, try making &amp;nbsp;Service Task 1 synchronous (so it is executed on the servlet thread that processed the user task).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not saying this will absolutely work since the error is coming out of the database and we essentially have a race condition. But worth a try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 May 2017 13:53:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29868#M12714</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-05-10T13:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Back to back Service task doesn't work</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29869#M12715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the stated solution, but didn't worked. Still getting&amp;nbsp;ActivitiOptimisticLockingException.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ami&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2017 12:54:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29869#M12715</guid>
      <dc:creator>ami</dc:creator>
      <dc:date>2017-05-11T12:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Back to back Service task doesn't work</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29870#M12716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, no real surprise.&lt;/P&gt;&lt;P&gt;Can you not combine the two services into a single service call?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2017 15:44:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/back-to-back-service-task-doesn-t-work/m-p/29870#M12716</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-05-11T15:44:12Z</dc:date>
    </item>
  </channel>
</rss>

