ASP.NET web self-maintainer as alternative to Windows service or SQL Agent
A looooong time ago, we're talking 8 years now, I prototyped a proof of concept of using a web site as an alternative to a Windows service or SQL Server Agent by retaining an application pool's uptime state and as such retaining an object that can maintain state and, for example, retain a service timer for Agent-like tasks. I implemented this by having the web application invoke itself over HTTP and store its state in the application cache.
I am not trying to push this so much as to ask for advice.开发者_开发百科 I am still pondering this as a reasonable alternative to SQL Agent for doing things like reminder e-mails, etc., for web applications. I know I can also do things like cron jobs (Scheduled Tasks service tasks, etc) or actual Windows Services, but at issue here is the fact that the web applications in question are in a closed environment that developers don't have access to and as such there's too much overhead in supporting non-web deployments of SQL Agent jobs and Windows services.
So again, are there other solutions to this problem than what I have been considering here?
I like quartz.net to handle the cron-like scheduling and state management. A less sophisticated solution is just wire up a simple System.Timer in Application_Start. The key is to make sure the app pool doesn't restart by ensuring traffic to the site (scheduling a task to ping the site) or if you are using IIS 7.5 you can use the auto-start feature.
精彩评论