Application_End

G

Guest

I have now confirmed that my application level objects are being killed
during worker process “recycleâ€. I was going to write some code to re-create
these objects at the Application_Start event however that event doesn’t fire
until the next request to the web site. The trouble here is that I need those
applications alive regardless of visits because they contain email timers.
It’s fine to lose it them for a few minutes but all weekend can really screw
things up.

So, from the Application_End even what is the best way to ‘re-start’ the
application because I noticed there is not a Application.Start method.

Thanks
 
C

Cowboy \(Gregory A. Beamer\)

The bad You can't from application end.

It is possible, however, to set up some form of watcher. The easiest would
be to set up a service that watches the app domain and restarts it when it
comes down. A cheap possibility (easy to code) is to fire an HTTP request
when the app comes down so the current App_start is fired. But, you can get
as sophisticated as you desire.

If possible, you can set up the email timer as a separate service, then it
would stay up regardless of the web application. You would communicate
through standard service endpoints from the web application. This could be a
better design, esp. if you see this type of application (email timer) used
in other applications.
 
P

Patrice

You could try to perform a request on the application though I'm not sure
how it will react if this done is done at this particular moment (Im' afrid
it will just result in "application unavailable").
Application pool settings might allow also to do that. Or you could schedule
requets to your app to make sure it is awake.

By far, my personal preference would be to avoid adding to an ASP.NET
application, things are have not their place in such an application. For
example it could be scheduled task, or a DB job rather than triggered by
timers from an ASP.NET application. Do you have total control on your
application or it is hosted somewhere ?
 
G

Guest

sean_mcad said:
I have now confirmed that my application level objects are being killed
during worker process “recycleâ€. I was going to write some code to re-create
these objects at the Application_Start event however that event doesn’t fire
until the next request to the web site. The trouble here is that I need those
applications alive regardless of visits because they contain email timers.
It’s fine to lose it them for a few minutes but all weekend can really screw
things up.

So, from the Application_End even what is the best way to ‘re-start’ the
application because I noticed there is not a Application.Start method.

Thanks

A web application is not supposed to be running continuosly. The web
server shuts down applications that are not used to preserve resources.

I would advice you to put any code that you need running at regular
intervals in a windows service, or in a program that you run
periodically from the scheduler.
 
G

Guest

Well its starting more and more to look like a windows service requirement
which really bites becuase I thought I was done with everything. (live and
learn).
Every aspect I look at the question that comes to my mind is "what if it
really needs to shut down and stay shut down" becuase every solution I can
come up with forces the application to restart which is not always a good
thing.
Such a solution would clearly be more extensible I just cant think of any
requirements that could extend it but given that just the other day I was
given more conditionals on when to send email I guess the future always
extends.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top