Configuring ADOJobStore with Quartz.net

☆樱花仙子☆ 提交于 2019-12-20 08:41:03

问题


How do you set up a jobstore with Quartz.net. The tutorial they have on the site is not that of help for me.

In this page though there are steps http://quartznet.sourceforge.net/tutorial/lesson_9.html I am not able to get how to set this one

org.quartz.jobStore.type = Quartz.Impl.AdoJobStore.JobStoreTX, Quartz 

Thanks


回答1:


Here's an adapted example of programmatic configuration from Quartz.NET's example 13:

NameValueCollection properties = new NameValueCollection();

properties["quartz.scheduler.instanceName"] = "TestScheduler";
properties["quartz.scheduler.instanceId"] = "instance_one";
properties["quartz.jobStore.type"] = "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz";
properties["quartz.jobStore.useProperties"] = "true";
properties["quartz.jobStore.dataSource"] = "default";
properties["quartz.jobStore.tablePrefix"] = "QRTZ_";
// if running MS SQL Server we need this
properties["quartz.jobStore.lockHandler.type"] = "Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz";

properties["quartz.dataSource.default.connectionString"] = "Server=(local);Database=quartz;Trusted_Connection=True;";
properties["quartz.dataSource.default.provider"] = "SqlServer-20";

// First we must get a reference to a scheduler
ISchedulerFactory sf = new StdSchedulerFactory(properties);
IScheduler sched = sf.GetScheduler();

You can also achieve the same thing with properties file based approach (the .config file).



来源:https://stackoverflow.com/questions/1455819/configuring-adojobstore-with-quartz-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!