I wanna to test ADOJobStore..
but where I can do configuring??
org.quartz.jobStore.class = Quartz.Impl.AdoJobStore.JobStoreTX, Quartz
Is there a external xml configuration file?
Thank you
If you want to do it programmatically (Example 13 from Quartz.NET distribution):
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.useProperties"] = "false";
properties["quartz.jobStore.dataSource"] = "default";
properties["quartz.jobStore.tablePrefix"] = "QRTZ_";
// 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"] =
"Server=(local);Database=quartz;Trusted_Connection=True;";
properties["quartz.dataSource.default.provider"] = "SqlServer-11";
// First we must get a reference to a scheduler
ISchedulerFactory sf = new StdSchedulerFactory(properties);
Or you can put these to quartz section of App.config, see
Quartz.Examples project's App.config.
By default Quartz initializes itself from embedded resource that's
inside Quartz assembly, but it uses RAMJobStore. You need to change
some settings if you use database other than SQL Server (connection
string, provider).
Hope this helps,
-Marko
properties["quartz.jobStore.lockHandler.type"] =
"Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz";
If you are running agains SQL Server.
Sorry for the confusion, I'll update the example according to this.
-Marko
Thank you so much~~~
I will try it at office tomorrow...
I will get back to you my result...
Thank you :)
Here is a feedback..
I am using code from example 13 as you said..
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"] =
"Server=(local);Database=quartz;Trusted_Connection=True;";
properties["quartz.dataSource.default.provider"] =
"SqlServer-11";
there is one mistake..
properties["quartz.jobStore.driverDelegateType"] =
"Quartz.Impl.AdoJobStore.MSSQLDelegate, Quartz";
I can't find a delegate is called
"Quartz.Impl.AdoJobStore.MSSQLDelegate", instead of
"Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz"
If I move this property or set property to
"Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz", it works.
I am using MS SQL 2005. Therefore, should I use this property?
There properties should be removed and you should use just:
properties["quartz.jobStore.lockHandler.type"] =
"Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz";
This wrong configuration was unfortunately left to example after some
refactoring, I fixed it yesterday to version control.
-Marko
yes, I get it...
Thank you so much~