Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>you can use AdoJobStore.<br> Quartz.net will use a set of tables with prefix <code>QRTZ_</code> (you can change it if you want) in your database to stored jobs, triggers and status of these objects.<br> I guess you want to have a table in your DB where you're going to keep extended information about your schedules, right?<br> You won't access Quartz.net table directly cause you will use the APIs provided by Quartz.net. </p> <p>The process to create a job detail and trigger is straightforward and described very well in the <a href="http://quartznet.sourceforge.net/tutorial/index.html">tutorials</a>.</p> <p>To configure your app to use the <a href="http://quartznet.sourceforge.net/tutorial/lesson_9.html">AdoJobStore</a> you have to specify few informations in your app.config file. Here is an example:</p> <pre><code> &lt;quartz&gt; &lt;add key="quartz.scheduler.instanceName" value="myApp" /&gt; &lt;add key="quartz.scheduler.instanceId" value="MyApp" /&gt; &lt;!-- Configure Thread Pool --&gt; &lt;add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" /&gt; &lt;add key="quartz.threadPool.threadCount" value="10" /&gt; &lt;add key="quartz.threadPool.threadPriority" value="Normal" /&gt; &lt;!-- Configure Job Store --&gt; &lt;add key="quartz.jobStore.misfireThreshold" value="60000" /&gt; &lt;add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" /&gt; &lt;add key="quartz.jobStore.useProperties" value="true" /&gt; &lt;add key="quartz.jobStore.dataSource" value="default" /&gt; &lt;add key="quartz.jobStore.tablePrefix" value="QRTZ_" /&gt; &lt;add key="quartz.jobStore.lockHandler.type" value="Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz" /&gt; &lt;add key="quartz.dataSource.default.connectionString" value="Server=SVSQL2008;Database=QuartzNet1;Trusted_Connection=True;" /&gt; &lt;add key="quartz.dataSource.default.provider" value="SqlServer-20" /&gt; &lt;/quartz&gt; </code></pre> <p>There are few things to keep in mind depending if you're hosting Quartz.net in a web application or a service or winform app. The best approach is to create SchedulerFactory and Scheduler as singleton. You can gather some more infos <a href="http://jvilalta.blogspot.com/search/label/quartz.net%201.0">here</a>.</p> <p><strong>UPDATE</strong>:</p> <p>First of all you have to create Quartz.net tables (see <a href="http://jvilalta.blogspot.com/2010/04/configuring-quartznet-with-adonet-job.html">Step 1</a>) and then you'll have to create a few indexes for optiomization (see bottom of the <a href="http://quartznet.sourceforge.net/faq.html#howtoimproveadojobstoreperf">page</a>).</p> <p>Since you're going to submit your jobs using the web app but you're not using that app for the quartz.net events (triggers) you don't need to start the scheduler. There are few steps to follow on this side:</p> <p>you have to change the thread pool type to <strong>ZeroSizeThreadPool</strong></p> <pre><code>&lt;add key="quartz.threadPool.type" value="Quartz.Simpl.ZeroSizeThreadPool, Quartz" /&gt; </code></pre> <p>and you have to define your StdSchedulerFactory and Scheduler singleton. You can start during the application (asp.net) bootstrap.</p> <p>You're never going to start the Scheduler (your windows service is going to use that).</p> <p>Another thing to remember is you're going to need share your <a href="http://quartznet.sourceforge.net/tutorial/lesson_2.html">job</a> between your web and your windows service, so it would be better to keep it in a separate assembly.</p> <p>You mentioned you're storing some infos in one of your table. You still need to have to submit your jobs and trigger which will be persisted in Quartz.net tables.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload