title: find if a job is running in Quartz1.6
body: <p>I would like to clarify details of the scheduler.getCurrentlyExecutingJobs() method in Quartz1.6. I have a job that should have only one instance running at any given moment. It can be triggered to "run Now" from a UI but if a job instance already running for this job - nothing should happen.</p>
  
  <p>This is  how I check whether there is a job running that interests me:</p>
  
  <pre><code>    List&lt;JobExecutionContext&gt; currentJobs = scheduler.getCurrentlyExecutingJobs();
      for (JobExecutionContext jobCtx: currentJobs){
      jobName = jobCtx.getJobDetail().getName();
      groupName = jobCtx.getJobDetail().getGroup();
      if (jobName.equalsIgnoreCase("job_I_am_looking_for_name") &amp;&amp;
          groupName.equalsIgnoreCase("job_group_I_am_looking_for_name")) {
          //found it!
          logger.warn("the job is already running - do nothing");
      }               
  }
  </code></pre>
  
  <p>then, to test this, I have a unit test that tries to schedule two instances of this job one after the other. I was expecting to see the warning when trying to schedule the second job, however, instead, I'm getting this exception:</p>
  
  <pre><code>org.quartz.ObjectAlreadyExistsException: Unable to store Job with name:
   'job_I_am_looking_for_name' and group: 'job_group_I_am_looking_for_name', 
   because one already exists with this identification.
  </code></pre>
  
  <p>When I run this unit test in a debug mode, with the break on this line:</p>
  
  <p>List currentJobs = scheduler.getCurrentlyExecutingJobs();</p>
  
  <p>I see the the list is empty - so the scheduler does not see this job as running , but it still fails to schedule it again - which tells me the job was indeed running at the time...</p>
  
  <p>Am I missing some finer points with this scheduler method?</p>
  
  <p>Thanks!</p>
  
  <p>Marina</p>