Note that there are some explanatory texts on larger screens.

plurals
  1. POQuartz.NET configuration - not interacting with db
    primarykey
    data
    text
    <p>I am a total noob to Quartz.net and writing windows services, so I apologize if this question is a bit uninformed.</p> <p>Anyway, I set up a windows service to use quartz.net to run another windows service which does some file cleanup. It installs and runs just fine (at least according to installutil and the net start command), but it never adds anything to the database. </p> <p>I created the db tables and everything and the db itself looks fine. Then, I created an app.config, which contains (i think) all of the config settings i need to be using to hook this thing up to the db. But for some reason, the db never gets touched. No triggers created (i obviously created them in code), no queued jobs, nothing.</p> <p>It is an oracle db, and all of the permissions are set up to allow read/write and everything.</p> <p>Here is the source code for the app.config:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;configuration&gt; &lt;configSections&gt; &lt;section name="quartz" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt; &lt;/configSections&gt; &lt;quartz&gt; &lt;add key="quartz.scheduler.instanceName" value="TestQuartzServer" /&gt; &lt;add key="quartz.scheduler.instanceId" value="instance_one" /&gt; &lt;add key="quartz.threadPool.threadCount" value="10" /&gt; &lt;add key="quartz.threadPool.threadPriority" value="Normal" /&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="false" /&gt; &lt;add key="quartz.jobStore.dataSource" value="default" /&gt; &lt;add key="quartz.jobStore.tablePrefix" value="QRTZ_" /&gt; &lt;add key="quartz.jobStore.clustered" value="true" /&gt; &lt;add key="quartz.jobStore.lockHandler.type" value="Quartz.Impl.AdoJobStore.SimpleSemaphore, Quartz" /&gt; &lt;add key="quartz.dataSource.default.connectionStringName" value="ConnectionString" /&gt; &lt;add key="quartz.dataSource.default.provider" value="OracleClient-20" /&gt; &lt;add key="quartz.jobStore.driverDelegateType" value="Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz" /&gt; &lt;/quartz&gt; &lt;connectionStrings&gt; &lt;add name="ConnectionString" connectionString= "Server=localhost;Database=Quartz;Uid=Quartz;Pwd=Quartz" /&gt; &lt;/connectionStrings&gt; &lt;/configuration&gt; </code></pre> <p>And here is the app source:</p> <pre><code>using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Linq; using System.ServiceProcess; using System.Text; using Quartz; using Quartz.Impl; using Quartz.Impl.Triggers; using System.Collections; namespace PurgeScheduler1 { public partial class Service1 : ServiceBase { public static IScheduler _scheduler; public Service1() { InitializeComponent(); } protected override void OnStart(string[] args) { try { ISchedulerFactory schedulerFactory = new StdSchedulerFactory(); _scheduler = schedulerFactory.GetScheduler(); _scheduler.Start(); AddJob(); } catch(Exception ex) { Console.WriteLine(ex.ToString()); } } protected override void OnStop() { } public static void AddJob() { IJob myJob = new MyJob(); JobDetailImpl jobDetail = new JobDetailImpl("Purge", "Group1", myJob.GetType()); CronTriggerImpl trigger = new CronTriggerImpl("Trigger1", "Group1", "When to run it goes here"); SimpleTriggerImpl trigger1 = new SimpleTriggerImpl("Trigger2", 10, TimeSpan.FromMinutes(2)); _scheduler.ScheduleJob(jobDetail, trigger1); DateTimeOffset? nextFireTime = trigger.GetNextFireTimeUtc(); Console.WriteLine("Next Fire Time:" + nextFireTime.Value); } } internal class MyJob : IJob { public void Execute(IJobExecutionContext context) { Console.WriteLine("In myJob class"); Process.Start("correct path, but hiding it for proprietary reasons"); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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