/** * Returns true if lock succeeded, or no lock was needed. * Returns false if locking was unsuccessfull. */ protected boolean lockJobIfNeeded() { try { if (job.isExclusive()) { processEngineConfiguration.getCommandExecutor().execute(new LockExclusiveJobCmd(job)); } } catch (Throwable lockException) { if (log.isDebugEnabled()) { log.debug("Could not lock exclusive job. Unlocking job so it can be acquired again. Catched exception: " + lockException.getMessage()); } // Release the job again so it can be acquired later or by another node unacquireJob(); return false; } return true; }
protected void unlockJobIfNeeded() { try { if (job.isExclusive()) { processEngineConfiguration.getCommandExecutor().execute(new UnlockExclusiveJobCmd(job)); } } catch (ActivitiOptimisticLockingException optimisticLockingException) { if (log.isDebugEnabled()) { log.debug("Optimistic locking exception while unlocking the job. 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 acquisition threads running against the same database. " + "Exception message: {}", optimisticLockingException.getMessage()); } } catch (Throwable t) { log.error("Error while unlocking exclusive job " + job.getId(), t); } }
public Object execute(CommandContext commandContext) { if (job == null) { throw new ActivitiIllegalArgumentException("job is null"); } if (log.isDebugEnabled()) { log.debug("Unlocking exclusive job {}", job.getId()); } if (job.isExclusive()) { if (job.getProcessInstanceId() != null) { ExecutionEntity execution = commandContext.getExecutionEntityManager().findById(job.getProcessInstanceId()); if (execution != null) { commandContext.getExecutionEntityManager().clearProcessInstanceLockTime(execution.getId()); } } } return null; } }
public Object execute(CommandContext commandContext) { if (job == null) { throw new ActivitiIllegalArgumentException("job is null"); } if (log.isDebugEnabled()) { log.debug("Executing lock exclusive job {} {}", job.getId(), job.getExecutionId()); } if (job.isExclusive()) { if (job.getExecutionId() != null) { ExecutionEntity execution = commandContext.getExecutionEntityManager().findById(job.getExecutionId()); if (execution != null) { commandContext.getExecutionEntityManager().updateProcessInstanceLockTime(execution.getProcessInstanceId()); } } } return null; } }
/** * Returns true if lock succeeded, or no lock was needed. * Returns false if locking was unsuccessfull. */ protected boolean lockJobIfNeeded() { try { if (job.isExclusive()) { processEngineConfiguration.getCommandExecutor().execute(new LockExclusiveJobCmd(job)); } } catch (Throwable lockException) { if (log.isDebugEnabled()) { log.debug("Could not lock exclusive job. Unlocking job so it can be acquired again. Catched exception: " + lockException.getMessage()); } // Release the job again so it can be acquired later or by another node unacquireJob(); return false; } return true; }
protected void unlockJobIfNeeded() { try { if (job.isExclusive()) { processEngineConfiguration.getCommandExecutor().execute(new UnlockExclusiveJobCmd(job)); } } catch (ActivitiOptimisticLockingException optimisticLockingException) { if (log.isDebugEnabled()) { log.debug("Optimistic locking exception while unlocking the job. 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 acquisition threads running against the same database. " + "Exception message: {}", optimisticLockingException.getMessage()); } } catch (Throwable t) { log.error("Error while unlocking exclusive job " + job.getId(), t); } }
public Object execute(CommandContext commandContext) { if (job == null) { throw new ActivitiIllegalArgumentException("job is null"); } if (log.isDebugEnabled()) { log.debug("Unlocking exclusive job {}", job.getId()); } if (job.isExclusive()) { if (job.getProcessInstanceId() != null) { ExecutionEntity execution = commandContext.getExecutionEntityManager().findById(job.getProcessInstanceId()); if (execution != null) { commandContext.getExecutionEntityManager().clearProcessInstanceLockTime(execution.getId()); } } } return null; } }
public Object execute(CommandContext commandContext) { if (job == null) { throw new ActivitiIllegalArgumentException("job is null"); } if (log.isDebugEnabled()) { log.debug("Executing lock exclusive job {} {}", job.getId(), job.getExecutionId()); } if (job.isExclusive()) { if (job.getExecutionId() != null) { ExecutionEntity execution = commandContext.getExecutionEntityManager().findById(job.getExecutionId()); if (execution != null) { commandContext.getExecutionEntityManager().updateProcessInstanceLockTime(execution.getProcessInstanceId()); } } } return null; } }