As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
18-May-2012 20:37:35 org.activiti.engine.impl.interceptor.CommandContext close SEVERE: Error while closing command context org.activiti.engine.ActivitiOptimisticLockingException: VariableInstanceEntity[17] was updated by another transaction concurrently at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:452)
<receiveTask id="syncProcess" name="Sync"></receiveTask>
<br>private RuntimeService runtimeService;<br>private Set<String> waitingProcesses = Collections.synchronizedSet(new HashSet<String>());<br>.<br>.<br>// create a thread for signaling waiting executions<br>Thread signalThread = new Thread(new Runnable() {<br> @Override<br> public void run() {<br> while (true) {<br> synchronized (waitingProcesses) {<br> Iterator<String> iterator = waitingProcesses.iterator();<br> while (iterator.hasNext()) {<br> String processId = iterator.next();<br> List<Execution> executions = runtimeService.createExecutionQuery().processInstanceId(processId)<br> .activityId("syncProcess").list();<br> for (Execution exec : executions) {<br> log.debug("Signaling waiting execution {}", exec.getId());<br> runtimeService.signal(exec.getId());<br> }<br> }<br> }<br> try {<br> Thread.sleep(1000);<br> } catch (InterruptedException e) {<br> return;<br> }<br> }<br> }<br>});<br>signalThread.start();<br>