<?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 5.17 - Async service tasks executed on multiple engines in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/5-17-async-service-tasks-executed-on-multiple-engines/m-p/223043#M176173</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have created a simple process consisting of a single user task and an async service task. The service task is implemented as a java delegate which sends an email to me with a unique identifier in the subject. I deployed this process and have process engines configured over the same activiti database with the async job executer enabled running on different VM's. I wrote a junit test which creates 50 process instances then completes the 50 user tasks. What I would expect to get back is 50 emails. This is always the case when the service task is not marked async. However, when it is marked as async I'm receiving a degree more, normally 70+. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some of these tasks are being executed by several process engines. Would this behavior be expected? If not I'd be grateful of some advice as to where I may be at error. Many thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Aug 2016 10:34:14 GMT</pubDate>
    <dc:creator>nofranks</dc:creator>
    <dc:date>2016-08-19T10:34:14Z</dc:date>
    <item>
      <title>5.17 - Async service tasks executed on multiple engines</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/5-17-async-service-tasks-executed-on-multiple-engines/m-p/223043#M176173</link>
      <description>Hi,I have created a simple process consisting of a single user task and an async service task. The service task is implemented as a java delegate which sends an email to me with a unique identifier in the subject. I deployed this process and have process engines configured over the same activiti dat</description>
      <pubDate>Fri, 19 Aug 2016 10:34:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/5-17-async-service-tasks-executed-on-multiple-engines/m-p/223043#M176173</guid>
      <dc:creator>nofranks</dc:creator>
      <dc:date>2016-08-19T10:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: 5.17 - Async service tasks executed on multiple engines</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/5-17-async-service-tasks-executed-on-multiple-engines/m-p/223044#M176174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you manage to enable both jobExecutor and asyncExecutor (possibly on different nodes), you'll run into this all the time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You should set exclusive flag on in tasks, so async jobs will have exclusive flag on, so async executor will lock process in DB to avoid parallel executions. Also you should make sure asyncJobLockTimeInMillis parameter is set properly to avoid job unlocking before previous task execution completes (or fails). &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It helps for the most part, but still it's possible to get "optimistic locks" from time to time. &lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 12:10:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/5-17-async-service-tasks-executed-on-multiple-engines/m-p/223044#M176174</guid>
      <dc:creator>warper</dc:creator>
      <dc:date>2016-08-19T12:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: 5.17 - Async service tasks executed on multiple engines</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/5-17-async-service-tasks-executed-on-multiple-engines/m-p/223045#M176175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, I figure I must have something wrong with the way in which I've configured the process engines but I can't see it. I have jobExectorActivate to false and asyncExecutorEnabled and asyncExecutorActivate to true. The asyncJobLockTimeInMillis is currently set at default but these executions only take around one second to complete. I've attached output from two different nodes that I think show the issue. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Both seem to claim the job, execute it, then one fails with an ActivitiOptimisticLock exception. This exception doesn't get back to me though so I can't do anything with it to correct the actions taken by the service task. Is this something for which I need to use an error boundary event to clean up after the failed execution?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The failed execution is in dev02_snippet.txt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2016 13:51:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/5-17-async-service-tasks-executed-on-multiple-engines/m-p/223045#M176175</guid>
      <dc:creator>nofranks</dc:creator>
      <dc:date>2016-08-22T13:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: 5.17 - Async service tasks executed on multiple engines</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/5-17-async-service-tasks-executed-on-multiple-engines/m-p/223046#M176176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think this may have been a bug with version 5.17. I have created a 5.21 setup and ran the same process and testing code over it which works as I'd expect it to, no duplication at all.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2016 08:23:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/5-17-async-service-tasks-executed-on-multiple-engines/m-p/223046#M176176</guid>
      <dc:creator>nofranks</dc:creator>
      <dc:date>2016-08-23T08:23:51Z</dc:date>
    </item>
  </channel>
</rss>

