title: Quartz with spring - clustered environment
body: <p>I'm using old version of quartz (2.1.2) with spring 3.1.0.
  I have simple configuration that should prevent parallel job execution:</p>
  
  <pre><code>&lt;bean id="schedulerFactoryBean" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"&gt;
      &lt;property name="jobFactory"&gt;
          &lt;bean class="com.azdne.infrastructure.schedule.ScheduledMethodJobFactory" /&gt;
      &lt;/property&gt;
      &lt;property name="dataSource" ref="schedulerDataSource" /&gt;
      &lt;property name="quartzProperties"&gt;
          &lt;props&gt;
              &lt;prop key="org.quartz.scheduler.instanceName"&gt;scheduler-cluster&lt;/prop&gt;
              &lt;prop key="org.quartz.jobStore.driverDelegateClass"&gt;org.quartz.impl.jdbcjobstore.StdJDBCDelegate&lt;/prop&gt;
              &lt;prop key="org.quartz.jobStore.isClustered"&gt;true&lt;/prop&gt;
              &lt;prop key="org.quartz.threadPool.threadCount"&gt;4&lt;/prop&gt;
              &lt;prop key="org.quartz.scheduler.instanceId"&gt;AUTO&lt;/prop&gt;
              &lt;prop key="org.quartz.scheduler.skipUpdateCheck"&gt;true&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>'threadCount' is set to 4 because I have more jobs to execute at scheduled time.
  I have also annotated my job class with @DisallowConcurrentExecution:</p>
  
  <pre><code>@Component 
  @DisallowConcurrentExecution
  public class MyJob{
     @Transactional(timeout=900)
     @Scheduled(cron = "0 0 2 * * ?")
     public void execute() {
     ... implementation goes here
     }
  }
  </code></pre>
  
  <p>Job can be started from one of two different server nodes that uses the same database for configuration purposes and data processing. Unfortunatelly my task <strong>sometimes</strong> starts on both of them. Sample application logs:</p>
  
  <pre><code>NODE 1: task-executor.log.2017-05-16.gz:16/05/2017 02:00:00.068 [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-3] INFO  com.package.schedule.job.MyJob.execute - MyJob job - start
  
  NODE 2: task-executor.log.2017-05-16.gz:16/05/2017 02:00:00.103 [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-1] INFO  com.package.schedule.job.MyJob.execute - MyJob job - start
  </code></pre>
  
  <p>This is unusual situation. Sometimes job starts on both machines, sometimes only on one. I have checked my application logs and didnt find any errors during data processing. Sometimes gap between job start is small - milliseconds, sometimes its seconds. <strong>Where should I look for mistake? Am I missing something in configuration?</strong> </p>