05-18-2012 01:52 PM
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)
05-23-2012 01:53 AM
<receiveTask id="syncProcess" name="Sync"></receiveTask>
private RuntimeService runtimeService;
private Set<String> waitingProcesses = Collections.synchronizedSet(new HashSet<String>());
.
.
// create a thread for signaling waiting executions
Thread signalThread = new Thread(new Runnable() {
@Override
public void run() {
while (true) {
synchronized (waitingProcesses) {
Iterator<String> iterator = waitingProcesses.iterator();
while (iterator.hasNext()) {
String processId = iterator.next();
List<Execution> executions = runtimeService.createExecutionQuery().processInstanceId(processId)
.activityId("syncProcess").list();
for (Execution exec : executions) {
log.debug("Signaling waiting execution {}", exec.getId());
runtimeService.signal(exec.getId());
}
}
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
return;
}
}
}
});
signalThread.start();
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.