<?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: How to handle or avoid an optimistic locking exception in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-handle-or-avoid-an-optimistic-locking-exception/m-p/32247#M13652</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct, there is just one Activiti engine running.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think the other scenario is related, mine is just one where a Java service task triggers something external to delete a process instance that happens to be the process instance the Java service task ran as, and it all happens quickly enough that the engine isn't done finishing up the process instance completion when the delete happens. &amp;nbsp;I sometimes get the exception in the delete and sometimes back to the client that completed the task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way for the asynchronous delete to check/know that the process instance is "in process" other than getting the exception? &amp;nbsp;If the exception only occurred in the client doing the delete, that would be fine, but it potentially happening on the process engine where the task is being completed and that seems like it would cause problems.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Mar 2017 18:38:38 GMT</pubDate>
    <dc:creator>schmke</dc:creator>
    <dc:date>2017-03-21T18:38:38Z</dc:date>
    <item>
      <title>How to handle or avoid an optimistic locking exception</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-handle-or-avoid-an-optimistic-locking-exception/m-p/32244#M13649</link>
      <description>I have an interesting scenario using 5.21 (moving to 5.22 and perhaps 6 soon) where I'm getting an ActivitiOptimisticLockingException. I'd like to figure out the best way to handle it or avoid it entirely.I have a process that has a user task that on completion has Java service task that calls an AP</description>
      <pubDate>Fri, 17 Mar 2017 18:21:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-handle-or-avoid-an-optimistic-locking-exception/m-p/32244#M13649</guid>
      <dc:creator>schmke</dc:creator>
      <dc:date>2017-03-17T18:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle or avoid an optimistic locking exception</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-handle-or-avoid-an-optimistic-locking-exception/m-p/32245#M13650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Schmke,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You've been heard, and actually there's &lt;A _jive_internal="true" href="https://community.alfresco.com/thread/230004-jobexecutor-and-acquirejobs-thread-competing" style="color: #2989c5;" rel="nofollow noopener noreferrer"&gt;another post about something similar&lt;/A&gt; that we're looking into. I need to look into this a bit further; if you have a minimalistic reproduction, that would help a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In 2013, one of the &lt;A _jive_internal="true" href="https://community.alfresco.com/thread/221722-activitioptimisticlockingexception-on-even-the-simplest-process" style="color: #2989c5;" rel="nofollow noopener noreferrer"&gt;Activiti gurus commented&lt;/A&gt; on this same issue saying that: "&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;This exception will only happen if you have multiple Activiti Engines with the job executor activated.&lt;SPAN style="color: #3d3d3d;"&gt;" Can you verify that this isn't the case?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;-JEarles&lt;BR /&gt;bp3&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2017 20:47:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-handle-or-avoid-an-optimistic-locking-exception/m-p/32245#M13650</guid>
      <dc:creator>jearles</dc:creator>
      <dc:date>2017-03-17T20:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle or avoid an optimistic locking exception</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-handle-or-avoid-an-optimistic-locking-exception/m-p/32246#M13651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I know Version 6 will not resolve this issue as it really isnt a defect.&lt;/P&gt;&lt;P&gt;The current instance IS a related instance and therefore is being returned correctly.&lt;/P&gt;&lt;P&gt;You can either exclude it from the set of instances being deleted, perhaps by including the current instance ID in the message and excluding it on your message handler, or you could change the order of processing, perhaps by delaying the firing of the message until after the current instance gets to a wait state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this gives you some ideas,&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;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2017 21:28:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-handle-or-avoid-an-optimistic-locking-exception/m-p/32246#M13651</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-03-17T21:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle or avoid an optimistic locking exception</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-handle-or-avoid-an-optimistic-locking-exception/m-p/32247#M13652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct, there is just one Activiti engine running.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think the other scenario is related, mine is just one where a Java service task triggers something external to delete a process instance that happens to be the process instance the Java service task ran as, and it all happens quickly enough that the engine isn't done finishing up the process instance completion when the delete happens. &amp;nbsp;I sometimes get the exception in the delete and sometimes back to the client that completed the task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way for the asynchronous delete to check/know that the process instance is "in process" other than getting the exception? &amp;nbsp;If the exception only occurred in the client doing the delete, that would be fine, but it potentially happening on the process engine where the task is being completed and that seems like it would cause problems.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 18:38:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-handle-or-avoid-an-optimistic-locking-exception/m-p/32247#M13652</guid>
      <dc:creator>schmke</dc:creator>
      <dc:date>2017-03-21T18:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle or avoid an optimistic locking exception</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-handle-or-avoid-an-optimistic-locking-exception/m-p/32248#M13653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The delete is presently asynchronous and doesn't know anything about the current instance ID unfortunately. &amp;nbsp;Ideally the engine would provide a way for the client doing the delete to know the instance is "in process" but I haven't determined a way to do that yet. &amp;nbsp;I considered doing a query to see if the instance has tasks (there should be none after the task is completed) but it appears that hasn't been persisted yet when the delete happens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could add a delay before trying the delete, but that feels like a hack and how long a delay is long enough? &amp;nbsp;I'm sure it would depend on the steps in the process after the Java service task that triggers the message causing the external delete.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could set a variable right after task completion to allow the delete to filter this specific one out, but if the instance is still being processed, will that variable be persisted yet and seen to be filtered on?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 18:43:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-handle-or-avoid-an-optimistic-locking-exception/m-p/32248#M13653</guid>
      <dc:creator>schmke</dc:creator>
      <dc:date>2017-03-21T18:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle or avoid an optimistic locking exception</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-handle-or-avoid-an-optimistic-locking-exception/m-p/32249#M13654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How you can&amp;nbsp;verify "&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;have multiple Activiti Engines with the job executor activated" ? Thanks!&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2017 18:02:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-handle-or-avoid-an-optimistic-locking-exception/m-p/32249#M13654</guid>
      <dc:creator>haridaniel</dc:creator>
      <dc:date>2017-11-29T18:02:44Z</dc:date>
    </item>
  </channel>
</rss>

