Integration with ASP.NET

1,186 views
Skip to first unread message

andre...@gmail.com

unread,
May 14, 2007, 8:50:50 AM5/14/07
to Quartz.NET

Hello,

I am looking into using Quartz.NET on a ASP.NET app. Is this possible?
I know that the worker process on IIS gets recycled once in a while.
Will this affect Quartz?

Thanks in advance

Andre' Oliveira

Marko Lahma

unread,
May 14, 2007, 9:12:54 AM5/14/07
to quar...@googlegroups.com
Hi Andre',

If you place your initialization of Quartz.NET to Application_Start
event in Global.asax it should be checked whenever application is
restarted. Of course this event will be raised _after_ the first
request to your application which could mean that on low traffic site
the Quartz.NET might not be initialized even daily.

For a foolproof solution I would use Windows Service to run these
maintenance tasks on the same box. Another option if you have IIS 6.0
you can set recycling time to some other value like none. Note that by
default IIS recycles every 1740 minutes which isn't 24 hours and might
cause confusion in production. I would advice to set this to some
other value like something occurring only nightly and at certain time.

-Marko

Awan

unread,
May 24, 2007, 11:59:20 AM5/24/07
to Quartz.NET
Hi Marko
We are developing a web based solution where we need to schedule jobs.
The user logs in, creates some jobs, creates a schedule for the job
and logs off. At the moment we are relying on windows services to run
these jobs. Not many hosting companies would allow us to mess with
their windows services. I was hoping to use quartz.net within our
(web) application to fire off schedules , but from your previous post,
it seems impossible to do that. Our application wont have many users,
Application_start may not run at all everyday. As I said playing with
IIS parameters is not an option for us ... any idea how to go about
it?
I am new to .NET, so just guessing, may be we start a new thread
within Application_start which somehow keeps application alive ?
Thanks

On May 14, 2:12 pm, "Marko Lahma" <marko.la...@gmail.com> wrote:
> Hi Andre',
>
> If you place your initialization of Quartz.NET to Application_Start
> event in Global.asax it should be checked whenever application is
> restarted. Of course this event will be raised _after_ the first
> request to your application which could mean that on low traffic site
> the Quartz.NET might not be initialized even daily.
>
> For a foolproof solution I would use Windows Service to run these
> maintenance tasks on the same box. Another option if you have IIS 6.0
> you can set recycling time to some other value like none. Note that by
> default IIS recycles every 1740 minutes which isn't 24 hours and might
> cause confusion in production. I would advice to set this to some
> other value like something occurring only nightly and at certain time.
>
> -Marko
>

Marko Lahma

unread,
May 26, 2007, 3:56:51 AM5/26/07
to quar...@googlegroups.com
Hi,

I'm afraid there is no silver bullet for this at least that I'm aware
of. ASP.NET can recycle process when it sees fit and thus making it
quite difficult to make sure that background tasks are kept alive as
wished.

You could design your application to tolerate this (jobs are run if
misfired a bit later - better than nothing) and run a external program
that pings the server in certain interval to make sure that ASP.NET
process is running - a simple wget or similar.

ASP.NET is not very friendly for background services. There's an
article on code project:
http://www.codeproject.com/aspnet/ASPNETService.asp
But this solution is hackish to say the least and I would generally
recommend against using ASP.NET model to something that it wasn't
designed for. It's for request-response processing.

Cheers,

-Marko

Reply all
Reply to author
Forward
0 new messages