1

We have windows service that runs quartz using the below configuration. We also have a mvc application with the same settings which is used to maintain the jobs and triggers for the cluster. But for some reason the jobs and triggers are being deleted, even if the job is durable.

<quartz>
    <add key="quartz.scheduler.instanceId" value="AUTO" />
    <add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
    <add key="quartz.threadPool.threadCount" value="10" />
    <add key="quartz.threadPool.threadPriority" value="Normal" />
    <add key="quartz.jobStore.misfireThreshold" value="60000" />
    <add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" />
    <add key="quartz.jobStore.tablePrefix" value="support.QRTZ_" />
    <add key="quartz.jobStore.dataSource" value="myDS" />
    <add key="quartz.jobStore.useProperties" value="true" />
    <add key="quartz.jobStore.clustered" value="true" />
    <add key="quartz.jobStore.clusterCheckinInterval" value="15000" />
    <add key="quartz.dataSource.paymentsDS.connectionString" value="connString" />
    <add key="quartz.dataSource.paymentsDS.provider" value="SqlServer-20" />
  </quartz>

Windows Service Start

    IScheduler scheduler = _schedulerFactory.GetScheduler();
    scheduler.JobFactory = _jobFactory;
    scheduler.Start();

MVC Manager

    IScheduler scheduler = _schedulerFactory.GetScheduler();
    scheduler.AddJob(jobDetail, false);
Thad
  • 1,518
  • 2
  • 21
  • 37
  • Do you actually see the jobs being added to the Sql Database? Is it possible that they aren't getting there in the first place, eg if MVC Manager does not have access to the SQL Database or if it is talking to a different server etc? And if they do get to the database, at what point do they get deleted? – sgmoore Aug 22 '12 at 19:55

1 Answers1

0

I reckon you have to change the configuration of your MVC Manager like this:

<quartz>
    <add key="quartz.scheduler.instanceId" value="AUTO" />
    <add key="quartz.threadPool.type" value="Quartz.Simpl.ZeroSizeThreadPool, Quartz" />
    <add key="quartz.jobStore.misfireThreshold" value="60000" />
    <add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" />
    <add key="quartz.jobStore.tablePrefix" value="support.QRTZ_" />
    <add key="quartz.jobStore.dataSource" value="myDS" />
    <add key="quartz.jobStore.useProperties" value="true" />
    <add key="quartz.jobStore.clustered" value="true" />
    <add key="quartz.jobStore.clusterCheckinInterval" value="15000" />
    <add key="quartz.dataSource.paymentsDS.connectionString" value="connString" />
    <add key="quartz.dataSource.paymentsDS.provider" value="SqlServer-20" />
  </quartz>

I have changed the ThreadPool Type to ZeroSizeThreadPool and removed

<add key="quartz.threadPool.threadCount" value="10" />
<add key="quartz.threadPool.threadPriority" value="Normal" />

You can find more info here.

Community
  • 1
  • 1
LeftyX
  • 35,328
  • 21
  • 132
  • 193