ADO.NET Job Store - Example Configuration

2,122 views
Skip to first unread message

icedre

unread,
Oct 16, 2007, 10:21:33 AM10/16/07
to Quartz.NET
Hi,

I try to configure my scheduler to ADO.NET Job Store, but I don't
understand some attributes in the tutorial (http://
quartznet.sourceforge.net/tutorial_lesson_9.html)... So I try this in
my Web.config:
<quartz>
<add key="org.quartz.jobStore.class"
value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz"/>
<add key="quartz.jobStore.driverDelegateClass"
value="Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz"/>
<add key="quartz.jobStore.tablePrefix" value="QRTZ_"/>
<add key="quartz.jobStore.dataSource" value="myDS"/>
<add key="quartz.dataSource.myDS.connectionString"
value="Server=MYHOST\SQLEXPRESS;Initial
Catalog=JOBSCHEDULER;Integrated Security=True"/>
<add key="quartz.dataSource.myDS.provider" value="SqlServer-20"/>
<add key="quartz.jobStore.useProperties" value="true"/>

<add key="quartz.scheduler.instanceName" value="MyScheduler"/>
<add key="quartz.threadPool.type"
value="Quartz.Simpl.SimpleThreadPool, Quartz"/>
<add key="quartz.threadPool.threadCount" value="10"/>
<add key="quartz.threadPool.threadPriority" value="2"/>
<add key="quartz.jobStore.misfireThreshold" value="500"/>
</quartz>

What is wrong in this config file??? - Somebody can give me an example
configuration of ADO.NET Job Store?
Thanks!

Marko Lahma

unread,
Oct 16, 2007, 1:10:31 PM10/16/07
to quar...@googlegroups.com
Hmm... it seems that the example on tutorial isn't quite in synch with
the current release. Please check example 13 of the distribution to
see configuration example (the tutorial might have wrong keys).

Sorry for the trouble, tutorial will be updated with the next release.

-Marko

icedre

unread,
Oct 17, 2007, 2:30:10 AM10/17/07
to Quartz.NET
Hi,

Thanks! Now I tryed this:
NameValueCollection properties = new
NameValueCollection();

properties["quartz.scheduler.instanceName"] =
"TestScheduler";
properties["quartz.scheduler.instanceId"] =
"instance_one";
properties["quartz.threadPool.type"] =
"Quartz.Simpl.SimpleThreadPool, Quartz";
properties["quartz.threadPool.threadCount"] = "5";
properties["quartz.threadPool.threadPriority"] = "Normal";
properties["quartz.jobStore.misfireThreshold"] = "60000";
properties["quartz.jobStore.type"] =
"Quartz.Impl.AdoJobStore.JobStoreTX, Quartz";
properties["quartz.jobStore.driverDelegateType"] =
"Quartz.Impl.AdoJobStore.MSSQLDelegate, Quartz";
properties["quartz.jobStore.useProperties"] = "false";
properties["quartz.jobStore.dataSource"] = "default";
properties["quartz.jobStore.tablePrefix"] = "QRTZ_";
properties["quartz.jobStore.clustered"] = "true";
// if running MS SQL Server we need this
properties["quartz.jobStore.selectWithLockSQL"] = "SELECT
* FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = @lockName";

properties["quartz.dataSource.default.connectionString"] =
ConfigurationManager.ConnectionStrings["JOBSCHEDULERConnectionString"].ConnectionString;
properties["quartz.dataSource.default.provider"] =
"SqlServer-20";

ISchedulerFactory sf = new
StdSchedulerFactory(properties);
s = sf.GetScheduler();


My ConnectionString: <add name="JOBSCHEDULERConnectionString"
connectionString="Data Source=W074\SQLEXPRESS;Initial
Catalog=JOBSCHEDULER;Integrated Security=True"
providerName="System.Data.SqlClient"/>

But it doesn't work... Error:
Couldn't determine job existence (myGroup.myJob): Couldn't instantiate
delegate: Could not load requested type:
Quartz.Impl.AdoJobStore.MSSQLDelegate, Quartz

What is wrong in my config?

Marko Lahma

unread,
Oct 17, 2007, 4:24:30 AM10/17/07
to quar...@googlegroups.com
There's no need for MSSQLDelegate anymore, so you are fine with the
default. The configuration example is old and has been changed. You
can remove the whole SQL Server setting and you can also replace
selectWithLockSQL to:

properties["quartz.jobStore.lockHandler.type"] =
"Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz";

Which is a better way. I unfortunately always reflect my advice to
current trunk which may not always be what you see in latest release
documentation or configuration wise.

Cheers,

-Marko

icedre

unread,
Oct 17, 2007, 5:05:34 AM10/17/07
to Quartz.NET
OK, thanks for the fast response!
Now it works fine :-))

Here is my config:
<quartz>


<add key="quartz.scheduler.instanceName" value="MyScheduler"/>

<add key="quartz.scheduler.instanceId" value="instance_one"/>


<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.type"
value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz"/>
<add key="quartz.jobStore.misfireThreshold" value="500"/>
<add key="quartz.jobStore.useProperties" value="false"/>
<add key="quartz.jobStore.dataSource" value="default"/>


<add key="quartz.jobStore.tablePrefix" value="QRTZ_"/>

<add key="quartz.jobStore.lockHandler.type"
value="Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz"/>
<add key="quartz.dataSource.default.connectionString" value="Data
Source=W074\SQLEXPRESS;Initial Catalog=QUARTZ;Integrated
Security=True"/>
<add key="quartz.dataSource.default.provider" value="SqlServer-20"/
>
</quartz>

Thanks again!

Reply all
Reply to author
Forward
0 new messages