title: How to maintain a job history using Quartz scheduler
body: <p>I'd like to maintain a history of jobs that were scheduled by a Quartz scheduler containing the following properties: 'start time', 'end time', 'success', 'error'.</p>
  
  <p>There are two interfaces available for this: <code>ITriggerListener</code> and <code>IJobListener</code> (I'm using the C# naming convention for interfaces because I'm using Quartz.NET but the same question could be asked for the Java version).</p>
  
  <p><code>IJobListener</code> has a <code>JobToBeExecuted</code> and a <code>JobWasExecuted</code> method. The latter provides a <code>JobExecutionException</code> so that you know when something went wrong. However, there is no way to correlate <code>JobToBeExecuted</code> and <code>JobWasExecuted</code>. Suppose my job runs for ten minutes. I start it at <code>t0</code> and <code>t0+2</code> (so they overlap). I get two calls to <code>JobToBeExecuted</code> and insert two start times into my history table. When both jobs finish at <code>t1</code> and <code>t1+2</code> I get two calls to <code>JobWasExecuted</code>. How do I know what database record to update in each call (to store an end time with its corresponding start time)?</p>
  
  <p><code>ITriggerListener</code> has another problem. There is no way to get any errors inside the <code>TriggerComplete</code> method when a job failed.</p>
  
  <p>How do I get the desired behavior?</p>