AnsweredAssumed Answered

job executor question

Question asked by whdwsl on Jan 27, 2015
Latest reply on Feb 18, 2015 by jbarrez
hi ,  it is  happy to know that: https://github.com/Activiti/Activiti/wiki/Notes-on-the-new-Actviti-Jobexecutor-(Oct-2014)


but in AcquireAsyncJobsDueCmd.class(5.17.0)  i  found code like this:

public AcquiredJobEntities execute(CommandContext commandContext) {
    AcquiredJobEntities acquiredJobs = new AcquiredJobEntities();
    List<JobEntity> jobs = commandContext
      .getJobEntityManager()
      .findAsyncJobsDueToExecute(new Page(0, asyncExecutor.getMaxAsyncJobsDuePerAcquisition()));
   
    for (JobEntity job: jobs) {
      lockJob(commandContext, job, asyncExecutor.getAsyncJobLockTimeInMillis());
      acquiredJobs.addJob(job);
      asyncExecutor.executeAsyncJob(job);
    }
   
    return acquiredJobs;
  }

where  is :  "Try to write the unique UUID of the job executor into as many job rows (big difference with original) as possible (UPDATE JOB set LOCK_OWNER_ = 'xxx' where LOCK_OWNER_ = null'). This is called 'acquiring' in the code. If nothing found, thread sleeps for a configurable amount of time."

Outcomes