<?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 OptimisticLocking exception when try to update execution-variable in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/optimisticlocking-exception-when-try-to-update-execution/m-p/245945#M199075</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;SPAN&gt;I have setup a spring activiti engine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I do a ProcessEngines.getDefaultProcessEngine(), will i get the same spring engine instance ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How many job-executors will i have ? (i have my default job-executor turned on in config, async-executor is off)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now the issue:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I startProceInstanceByKey(), and set a variable named 'envelop' in variableMap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a process which has a service task. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. This service task delegate (of type TaskActivityBehavior) puts a JMS message on ActiveMQ and a MessageListener reads it and makes REST call to external service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. The external service returns response via an REST end point in my system.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. During this time my service task is waiting for a signal.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. I am trying to update the value of variable 'envelop' with response received from external service. I use ProcessEngines.getDefaultProcessEngine().getRuntimeService().setVariable("envelop",newValue);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5. I signal the waiting serviceTask using the stored executionID. I use ProcessEngines.getDefaultProcessEngine().getRuntimeService().signal(envelop.getExecutionId());&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I ran above process to spawn 100 processInstances. Out of which 96 succeeded, but 4 failed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;All four had same reason. In Step 4 above, while updating the execution variable it throws OptimisticLocking error as below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;org.activiti.engine.ActivitiOptimisticLockingException: ByteArrayEntity[id=290, name=var-envelop, size=335] was updated by another transaction concurrently.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kindly help, my envelop variable is associated with different executionID, there is no case where someone else will update it in another transaction.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 07 Feb 2016 09:10:11 GMT</pubDate>
    <dc:creator>shreyashp</dc:creator>
    <dc:date>2016-02-07T09:10:11Z</dc:date>
    <item>
      <title>OptimisticLocking exception when try to update execution-variable</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/optimisticlocking-exception-when-try-to-update-execution/m-p/245945#M199075</link>
      <description>Hi,I have setup a spring activiti engine.I do a ProcessEngines.getDefaultProcessEngine(), will i get the same spring engine instance ?How many job-executors will i have ? (i have my default job-executor turned on in config, async-executor is off)Now the issue:I startProceInstanceByKey(), and set a v</description>
      <pubDate>Sun, 07 Feb 2016 09:10:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/optimisticlocking-exception-when-try-to-update-execution/m-p/245945#M199075</guid>
      <dc:creator>shreyashp</dc:creator>
      <dc:date>2016-02-07T09:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: OptimisticLocking exception when try to update execution-variable</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/optimisticlocking-exception-when-try-to-update-execution/m-p/245946#M199076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;StackTrace:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;org.activiti.engine.ActivitiOptimisticLockingException: ByteArrayEntity[id=592, name=var-envelop, size=335] was updated by another transaction concurrently&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:875)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:614)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:212)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:138)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:66)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.RuntimeServiceImpl.setVariable(RuntimeServiceImpl.java:186)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Feb 2016 09:23:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/optimisticlocking-exception-when-try-to-update-execution/m-p/245946#M199076</guid>
      <dc:creator>shreyashp</dc:creator>
      <dc:date>2016-02-07T09:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: OptimisticLocking exception when try to update execution-variable</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/optimisticlocking-exception-when-try-to-update-execution/m-p/245947#M199077</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;could you reproduce the issue in the jUnit test please?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://forums.activiti.org/content/sticky-how-write-unit-test" rel="nofollow noopener noreferrer"&gt;https://forums.activiti.org/content/sticky-how-write-unit-test&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 08:09:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/optimisticlocking-exception-when-try-to-update-execution/m-p/245947#M199077</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2016-02-08T08:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: OptimisticLocking exception when try to update execution-variable</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/optimisticlocking-exception-when-try-to-update-execution/m-p/245948#M199078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;About your questions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"I do a ProcessEngines.getDefaultProcessEngine(), will i get the same spring engine instance ?"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes. It will return the same ProcessEngine instance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"How many job-executors will i have ? (i have my default job-executor turned on in config, async-executor is off)"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One. The 'old' job executor will be used (async executor is the new one).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2016 07:54:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/optimisticlocking-exception-when-try-to-update-execution/m-p/245948#M199078</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-02-09T07:54:47Z</dc:date>
    </item>
  </channel>
</rss>

