title: Scheduling concurrent jobs in quartz.net
body: <p>I need some help. I am trying to figure out how to schedule dependent jobs with quartz.net and try to avoid conflicts as am using connection to database.
  i have a web application with 3 classes: DownloadJob, UploadJob, Table1-Table2Job.
  <strong><em>DownloadJob</em></strong> downloads items from a mysql db to an Sql db every day at 4am.
  <strong><em>UploadJob</em></strong>  execute an update query to mysql db from an sql table(Table2) every 4 min.
  <strong><em>Table1-Table2Job</em></strong> is on charge of transferring items from an sql table to another sql table every 20 min.</p>
  
  <p>The big problem is how to deal with connection conflicts.
  UploadJob must wait if Table1-Table2Job is in progress. and then go on.
  As Table1-Table2Job must wait if UploadJob is in progress.
  Download must always go.</p>
  
  <p>i have create a Scheduler Class wish code is:</p>
  
  <pre><code>public class JobScheduler
  {
  
  
      public static void Start()
      {
          Ul1_Ul2dbJob classU1_U2Job = new Ul1_Ul2dbJob();
          UploadJob classUpJob = new UploadJob();
          IScheduler schedulerDownload = StdSchedulerFactory.GetDefaultScheduler();
  
          IScheduler schedulerUl1_Ul2 = StdSchedulerFactory.GetDefaultScheduler();
          //schedulerUl1_Ul2.Start();
          IScheduler schedulerUpload = StdSchedulerFactory.GetDefaultScheduler();
          //schedulerUpload.Start();
  
  
          IJobDetail jobDown = JobBuilder.Create&lt;DownloadJob&gt;().Build();
          IJobDetail jobUpl = JobBuilder.Create&lt;UploadJob&gt;().Build();
          IJobDetail jobUl1_Ul2 = JobBuilder.Create&lt;Ul1_Ul2dbJob&gt;().Build();
  
          //Trigger di Download
          ITrigger trigger = TriggerBuilder.Create()
              .WithDailyTimeIntervalSchedule
                (s =&gt;
                   s.WithIntervalInHours(24)
                  .OnEveryDay()
                  .StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(03, 00))
                )
              .Build();
          //       ITrigger trigger =   TriggerBuilder.Create()
          //.WithCronSchedule(string.Format(cronFormat))
          //.Build();
  
          //trigger dei Upload
          ITrigger trigger1 = TriggerBuilder.Create()
             .WithCronSchedule("0 0/1 * * * ?")
             .StartNow()
             .WithPriority(1)
             .Build();
          //trigger per spostamento UL1 a UL2
          ITrigger trigger2 = TriggerBuilder.Create()
             .WithCronSchedule("0 0/1 * * * ?")
             .StartNow()
             .WithPriority(1)
             .Build();
          schedulerUpload.Start();
          schedulerUl1_Ul2.Start();
          schedulerUpload.ScheduleJob(jobUpl, trigger1);
          schedulerUl1_Ul2.ScheduleJob(jobUl1_Ul2, trigger2);
          //schedulerUpload.ScheduleJob(jobUl1_Ul2, trigger2);
  
  
  
  
          //// scheduling with use of function Lock()
          lock (schedulerDownload)
          {
              schedulerDownload.Start();
              schedulerDownload.ScheduleJob(jobDown, trigger);
          }
      }**
  </code></pre>
  
  <p>Some one can help me?</p>