<?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: VariableInstanceEntity was updated by another transaction in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34397#M18010</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The ActivitiOptimisticLockingException is exactly created for that reason: to indicate that some entity was modified by two (or more) people at the same time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So what you can do is catch the exception and retry (however, the 'old' value of the variable will then be lost).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Jan 2011 13:09:44 GMT</pubDate>
    <dc:creator>jbarrez</dc:creator>
    <dc:date>2011-01-05T13:09:44Z</dc:date>
    <item>
      <title>VariableInstanceEntity was updated by another transaction</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34389#M18002</link>
      <description>Sometimes I had this error in my logs files&lt;IMG id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://migration33.stage.lithium.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;rg.activiti.engine.ActivitiOptimisticLockingException: VariableInstanceEntity[2002635] was updated by another transaction concurrently&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:390)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.activiti.engine.imp</description>
      <pubDate>Tue, 04 Jan 2011 10:51:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34389#M18002</guid>
      <dc:creator>jcosano</dc:creator>
      <dc:date>2011-01-04T10:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: VariableInstanceEntity was updated by another transaction</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34390#M18003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Invoke code is this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;Map&amp;lt;String, Object&amp;gt; variables = runtime.getVariables(key);&lt;BR /&gt;variables.put("noocur",newNum);&lt;BR /&gt;…&lt;BR /&gt;…&lt;BR /&gt;runtime.setVariables(key, variables);&amp;nbsp; &lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Then, maybe revision number for "variable" change between read and write…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I protect this? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;maybe I should syncronized this code?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 12:52:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34390#M18003</guid>
      <dc:creator>jcosano</dc:creator>
      <dc:date>2011-01-04T12:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: VariableInstanceEntity was updated by another transaction</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34391#M18004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You should make sure that you don't have different threads updating the same variable on the same process instance at the same time using API. This will cause the optimistic locking exceptions you are getting.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 13:02:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34391#M18004</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-01-04T13:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: VariableInstanceEntity was updated by another transaction</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34392#M18005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I had a process A that read a DB2 table, and for each row readed, creates a process instance of process B, and after sleeps 10 minutes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Process B, create a new process instance of Process C, or update variables from C (if exists).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This problem occurs in process B (updating variables…)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then, it's true, that maybe a high number of process instance create in process A, are updating the same process instance C…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I'm thinking 2 ways..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;a) synchro this code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;b) capture exception, and read, modify, and save another time…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What do you think is better?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 14:41:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34392#M18005</guid>
      <dc:creator>jcosano</dc:creator>
      <dc:date>2011-01-04T14:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: VariableInstanceEntity was updated by another transaction</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34393#M18006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If I understand you correctly, you are creating new processes from within another process? Are you using the API (runtimeService.startProcess…) from within a JavaDelagate?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 15:59:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34393#M18006</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-01-04T15:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: VariableInstanceEntity was updated by another transaction</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34394#M18007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You are correct…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Process A… in execution method do a loop with:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;engine.getRuntimeService().startProcessInstanceByKey("B",variables);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Process B:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if not exists creates a Process C, or if exist update C variables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And a high number of A can uses same Process C.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 16:09:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34394#M18007</guid>
      <dc:creator>jcosano</dc:creator>
      <dc:date>2011-01-04T16:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: VariableInstanceEntity was updated by another transaction</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34395#M18008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Using the activiti API from within activiti-context (JavaDelegate or TaskListeners) is a bad idea, this can mess up command-context and transactions in activiti. When you start a process-instance this way, the thread that drives the execution (which is used to invoke your code) will be used to run the spawned process instance (until it ends or reaches a wait-state).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;About the best way to ensure no process-instances are updated at the same time, I'm not sure either what is the best way to handle this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 16:18:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34395#M18008</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-01-04T16:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: VariableInstanceEntity was updated by another transaction</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34396#M18009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Process A:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Has two activity: serviceTask and userTask with boundaryEvent for sleep… and return to serviceTask&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Process B&amp;nbsp; is silly:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;startEvent&amp;nbsp; /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;serviceTask&amp;nbsp; /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;endEvent&amp;nbsp; /&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Process C is complex (and has integration with people), but first activity it's a userTask…&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then B and C arrives to end or wait state quickly… &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And only strange that I see is this transaction problem… and only 6 times en 1 month (maybe I was lucky!! &lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt; )&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 16:44:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34396#M18009</guid>
      <dc:creator>jcosano</dc:creator>
      <dc:date>2011-01-04T16:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: VariableInstanceEntity was updated by another transaction</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34397#M18010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The ActivitiOptimisticLockingException is exactly created for that reason: to indicate that some entity was modified by two (or more) people at the same time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So what you can do is catch the exception and retry (however, the 'old' value of the variable will then be lost).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jan 2011 13:09:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34397#M18010</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2011-01-05T13:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: VariableInstanceEntity was updated by another transaction</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34398#M18011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Old value is not a problem because the most important value it is a counter… and I only need sum 1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I suppose that finally, I'll catch exception, and try to retry (read-modify-save).. and I'll use a counter for prevent a infinite loop.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jan 2011 13:15:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/variableinstanceentity-was-updated-by-another-transaction/m-p/34398#M18011</guid>
      <dc:creator>jcosano</dc:creator>
      <dc:date>2011-01-05T13:15:34Z</dc:date>
    </item>
  </channel>
</rss>

