PC Review


Reply
Thread Tools Rate Thread

Application_End

 
 
=?Utf-8?B?c2Vhbl9tY2Fk?=
Guest
Posts: n/a
 
      2nd Apr 2007
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

 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      2nd Apr 2007
The bad news: 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.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*********************************************
Think outside the box!
*********************************************
"sean_mcad" <(E-Mail Removed)> wrote in message
news:9525CAFC-081D-4049-97AE-(E-Mail Removed)...
>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
>


 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      2nd Apr 2007
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 ?
---
Patrice

"sean_mcad" <(E-Mail Removed)> a crit dans le message de
news: 9525CAFC-081D-4049-97AE-(E-Mail Removed)...
>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
>



 
Reply With Quote
 
=?UTF-8?B?R8O2cmFuIEFuZGVyc3Nvbg==?=
Guest
Posts: n/a
 
      2nd Apr 2007
sean_mcad wrote:
> 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öran Andersson
_____
http://www.guffa.com
 
Reply With Quote
 
=?Utf-8?B?c2Vhbl9tY2Fk?=
Guest
Posts: n/a
 
      3rd Apr 2007
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.

"Cowboy (Gregory A. Beamer)" wrote:

> The bad news: 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.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> http://gregorybeamer.spaces.live.com
>
> *********************************************
> Think outside the box!
> *********************************************
> "sean_mcad" <(E-Mail Removed)> wrote in message
> news:9525CAFC-081D-4049-97AE-(E-Mail Removed)...
> >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
> >

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application_End Ido Microsoft ASP .NET 2 14th Feb 2006 01:43 PM
Application_End AGB Microsoft ASP .NET 4 18th Jan 2005 10:08 PM
What causes Application_End? Philipp Schumann Microsoft ASP .NET 1 23rd Apr 2004 02:10 AM
Application_End never executes Pedro Duque Microsoft C# .NET 1 5th Nov 2003 03:28 PM
Re: Application_End noname Microsoft ASP .NET 0 16th Jul 2003 07:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:16 PM.