0

I'm using quartz .net server embedded in my asp.net application but is always turning into standby mode. Even with a scheduled cron job in NORMAL mode.

Those are my scheduler properties:

var properties = new NameValueCollection();

        properties["quartz.dataSource.DataSource.connectionString"] = "data source=connectionstring";
        properties["quartz.dataSource.DataSource.provider"] = "SqlServer-20";

        properties["quartz.scheduler.instanceName"] = "MyScheduler";

        properties["quartz.threadPool.type"] = "Quartz.Simpl.SimpleThreadPool, Quartz";
        properties["quartz.threadPool.threadCount"] = "5";
        properties["quartz.threadPool.threadPriority"] = "Normal";

        properties["quartz.jobStore.type"] = "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz";
        properties["quartz.jobStore.driverDelegateType"] = "Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz ";
        properties["quartz.jobStore.tablePrefix"] = "QRTZ_";
        properties["quartz.jobStore.dataSource"] = "DataSource";
        properties["quartz.jobStore.useProperties"] = "true";

        return new StdSchedulerFactory(properties);

How to make it always running? Do I need to run it as a windows service?

joaofs
  • 486
  • 1
  • 7
  • 17
  • See http://stackoverflow.com/questions/1306380/can-you-prevent-your-asp-net-application-from-shutting-down – sgmoore Sep 18 '13 at 10:27
  • Does it make sense if the scheduled job is running every 5 minutes? – joaofs Sep 18 '13 at 11:12
  • I could be wrong, but my understanding is that a website is considered idle if no users were connected to it and it didn't really matter if the website is actually running code. I assumed the logic is that, if the website was performing a long running task and the user got fed up and left, then there was no point continuing with the task. – sgmoore Sep 18 '13 at 11:56
  • Yes you were right, building it as a service and connect it remotely should be wiser. If you state your comment as an answer I'll accept it. – joaofs Oct 08 '13 at 08:34

1 Answers1

0

Running the Quartz.net scheduler as a windows service seems to be best method.

The default for IIS is to shutdown any ASP.net applications if there are no users connected to them, which means your scheduler is no longer running. It is possible to change these defaults (see Can you prevent your ASP.NET application from shutting down?), but a better way is to write your scheduler as a windows service.

Community
  • 1
  • 1
sgmoore
  • 15,694
  • 5
  • 43
  • 67