AnsweredAssumed Answered

using asyncExecutor but ActivitiOptimisticLockingException on activiti 5.21.0

Question asked by gavin_huang on Oct 22, 2016
Latest reply on Dec 19, 2016 by thuynh
Hi,

In my workflow,
1. there is a Multi-instance sub-process
2. the task on Subprocess are service task
3. all "service task" set activiti:async="true" activiti:exclusive="false"
the image as attachement

the config as follow:
<bean id="asyncExecutor"
      class="org.activiti.engine.impl.asyncexecutor.DefaultAsyncJobExecutor">
      <property name="corePoolSize" value="10" />
      <property name="maxPoolSize" value="50" />
      <property name="keepAliveTime" value="3000000" />
      <property name="queueSize" value="200" />
      <property name="maxTimerJobsPerAcquisition" value="2" />
      <property name="maxAsyncJobsDuePerAcquisition" value="2" />
      <property name="defaultAsyncJobAcquireWaitTimeInMillis"
         value="6000000" />
      <property name="defaultTimerJobAcquireWaitTimeInMillis"
         value="6000000" />
      <property name="timerLockTimeInMillis" value="1800000" />
      <property name="asyncJobLockTimeInMillis" value="1800000" />
   </bean>

when run , the exception as follow:

02:23:43,793 [pool-1-thread-6] DEBUG org.activiti.engine.impl.interceptor.CommandContext  - Optimistic locking exception : org.activiti.engine.ActivitiOptimisticLockingException: VariableInstanceEntity[id=904513d7-968d-11e6-b78c-507b9d5d39ec, name=nrOfActiveInstances, type=integer, longValue=20, textValue=20] was updated by another transaction concurrently
}02:23:43,886 [pool-1-thread-6] DEBUG org.activiti.engine.impl.interceptor.LogInterceptor  - — ExecuteAsyncJobCmd finished ——————————————————–
}02:23:43,886 [pool-1-thread-6] DEBUG org.activiti.engine.impl.interceptor.LogInterceptor  -

…….

02:23:43,908 [pool-1-thread-6] DEBUG org.activiti.engine.impl.persistence.entity.JobEntity.updateMessage  - ==> Parameters: 2(Integer), null, null, 2(Integer), c01cd949-968d-11e6-b78c-507b9d5d39ec(String), VariableInstanceEntity[id=904513d7-968d-11e6-b78c-507b9d5d39ec, name=nrOfActiveInstances, type=integer, longValue=20, textValue=20] was updated by another transaction concurrently(String), 2016-10-20 14:23:53.905(Timestamp), 907e9ad4-968d-11e6-b78c-507b9d5d39ec(String), 1(Integer)
}02:23:43,909 [pool-1-thread-6] DEBUG org.activiti.engine.impl.persistence.entity.JobEntity.updateMessage  - <==    Updates: 1
}02:23:43,948 [pool-1-thread-6] DEBUG org.activiti.engine.impl.interceptor.LogInterceptor  - — JobRetryCmd finished ——————————————————–
}02:23:43,948 [pool-1-thread-6] DEBUG org.activiti.engine.impl.interceptor.LogInterceptor  -

}02:23:43,949 [pool-1-thread-6] DEBUG org.activiti.engine.impl.interceptor.LogInterceptor  - —  finished ——————————————————–
}02:23:43,949 [pool-1-thread-6] DEBUG org.activiti.engine.impl.interceptor.LogInterceptor  -

}02:23:43,949 [pool-1-thread-6] DEBUG org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable  - Optimistic locking exception during job execution. If you have multiple async executors running against the same database, this exception means that this thread tried to acquire an exclusive job, which already was changed by another async executor thread.This is expected behavior in a clustered environment. You can ignore this message if you indeed have multiple job executor threads running against the same database. Exception message: VariableInstanceEntity[id=904513d7-968d-11e6-b78c-507b9d5d39ec, name=nrOfActiveInstances, type=integer, longValue=20, textValue=20] was updated by another transaction concurrently
}02:23:43,950 [pool-1-thread-6] DEBUG org.activiti.engine.impl.interceptor.LogInterceptor  -

Attachments

Outcomes