<?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: Adding Event Listener not Thread Safe in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181350#M134480</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can see vaguely the use cas,e but not yet fully convinced. I'm always very weary of adding synchronized code, as it slows things down obviously. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or is it only the collection of event listeners you want to make thread safe? Ie a simple synchronizedMap would suffice?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Nov 2014 08:08:03 GMT</pubDate>
    <dc:creator>jbarrez</dc:creator>
    <dc:date>2014-11-20T08:08:03Z</dc:date>
    <item>
      <title>Adding Event Listener not Thread Safe</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181347#M134477</link>
      <description>Hello,when adding a event listener during runtime I get (in unit tests) a ConcurrentModificationException because at the same time I add the listener an event is dispatched (see exception below).The error occurs here, while dispatching an event through the listeners the eventListeners array is modif</description>
      <pubDate>Mon, 10 Nov 2014 12:44:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181347#M134477</guid>
      <dc:creator>elmarweber</dc:creator>
      <dc:date>2014-11-10T12:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Event Listener not Thread Safe</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181348#M134478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No, looking at the code it was clearly not designed to add an event listener during the dispatching of another event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What's the use case for this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 19:24:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181348#M134478</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-11-18T19:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Event Listener not Thread Safe</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181349#M134479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We are adding a listener for certain executions of single instances and them removing them. Overall more complicated topic, in the end we use Activiti to generate execution correct flows for simulation on large datasets (can elaborate on that when someone is really interested =). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At the moment we worked around it by registering a global listener and then registering our temporary listener to it. Our global listener is thread safe and makes sure this does not happen anymore (will be replaced with an Akka actor system in the future).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IMHO this is behavior that should be fixed in Activiti, as it can also happen during normal operations as well. E.g. when using a server wide Activiti engine that has several applications deployed using it. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know your thoughts.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 19:53:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181349#M134479</guid>
      <dc:creator>elmarweber</dc:creator>
      <dc:date>2014-11-18T19:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Event Listener not Thread Safe</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181350#M134480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can see vaguely the use cas,e but not yet fully convinced. I'm always very weary of adding synchronized code, as it slows things down obviously. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or is it only the collection of event listeners you want to make thread safe? Ie a simple synchronizedMap would suffice?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 08:08:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181350#M134480</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-11-20T08:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Event Listener not Thread Safe</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181351#M134481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, only the registration needs synchronization, so the collection is fine.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 09:52:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181351#M134481</guid>
      <dc:creator>elmarweber</dc:creator>
      <dc:date>2014-11-20T09:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Event Listener not Thread Safe</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181352#M134482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Okay. Can you create a pull request for it so we can discuss it further there?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2014 13:50:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181352#M134482</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-12-05T13:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Event Listener not Thread Safe</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181353#M134483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;any update regarding this issue (&amp;lt;a href="&lt;/SPAN&gt;&lt;A href="https://github.com/Activiti/Activiti/issues/886" rel="nofollow noopener noreferrer"&gt;https://github.com/Activiti/Activiti/issues/886&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;Issue 886&amp;lt;/a&amp;gt;)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 14:59:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181353#M134483</guid>
      <dc:creator>faizal-manan</dc:creator>
      <dc:date>2016-05-19T14:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Event Listener not Thread Safe</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181354#M134484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;One option to solve this is to remove the event listener after they're fired, for example using a CommandContextCloseListener.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 08:24:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181354#M134484</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-05-31T08:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Event Listener not Thread Safe</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181355#M134485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just an update from me, unfortunately I can't find the code anymore and I'm trying to remember how we fixed it, I think we synchronized externally as a fast work around. In the end we switched to a simpler BPMN engine implementation that is more light weight because we were just generating execution flows for simulation purposes. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 08:32:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181355#M134485</guid>
      <dc:creator>elmarweber</dc:creator>
      <dc:date>2016-05-31T08:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Event Listener not Thread Safe</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181356#M134486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;FYI: The event list was changed to a CopyOnWrite implementation this week, so this problem should be solved.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2016 07:29:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-event-listener-not-thread-safe/m-p/181356#M134486</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-06-03T07:29:00Z</dc:date>
    </item>
  </channel>
</rss>

