473,326 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Application_End

Ido
Hi,
If asp process is being recycled/restarted gracefully, will Application_End
allways be called?
In addition, according to :
http://www.codecomments.com/archive2...-2-393853.html one can understand
that Application_End may not be able to finish its execution before the
process is shut-down. That does not sound reasonable to me. What d'you say?

Thanks,
Ido
Feb 12 '06 #1
2 3225
Hi Ido,
If asp process is being recycled/restarted gracefully, will
Application_End allways be called?
When the worker process is recycled, it is shut down, which means, yes,
Application_End will be called.
In addition, according to :
http://www.codecomments.com/archive2...-2-393853.html one can
understand that Application_End may not be able to finish its execution
before the process is shut-down. That does not sound reasonable to me.
What d'you say?
Well, Scott *is* an MVP, but first, to be fair, he didn't state
authoritatively that he knew how much time the process would have to shut
down. He guessed.

I'm not surprised that he guessed either. It took me over an hour to run
down this information for you. Luckily, it's Sunday! Here's the straight
dope:

When the ASP.Net worker process is shut down, there is a time limit set on
how long the server will wait before shutting down the process. How this
time limit is set on an IIS 6 box depends upon the execution model being
used for ASP.Net. By default, ASP.Net apps run in IIS 5 "Worker Process
Isolation Mode." This means that each worker process is run in an IIS 6.0
Application pool. The "Health" tab of the Application Pool Properties dialog
box is used to set the "Shutdown Time Limit" for that pool. This corresponds
to the "shutdowntimeout" value in the <processmodel> section of the
machine.config file, which is used in IIS 5 for all ASP.Net applications,
and in IIS 6 ASP.Net applications running in "IIS 5.0 Isolation Mode."

It should be noted, of course, that one cannot guarantee that the code in
the Application_End method of the global.asax class will complete before the
time limit is reached. Good programming practice would dictate that you
handle the eventuality that it doesn't. Bottom line is, whenever you use
memory to cache data, make sure to account for the eventuality that the data
will disappear for one reason or another.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
We got a sick zebra a hat,
you ultimate tuna.
"Ido" <id*@tgs-systems.com> wrote in message
news:Oc***************@TK2MSFTNGP14.phx.gbl... Hi,
If asp process is being recycled/restarted gracefully, will
Application_End allways be called?
In addition, according to :
http://www.codecomments.com/archive2...-2-393853.html one can
understand that Application_End may not be able to finish its execution
before the process is shut-down. That does not sound reasonable to me.
What d'you say?

Thanks,
Ido

Feb 12 '06 #2
Ido
Thank you so much for that answer.
Just the answer i needed.

Again,thanks,
Ido

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:eS**************@TK2MSFTNGP11.phx.gbl...
Hi Ido,
If asp process is being recycled/restarted gracefully, will
Application_End allways be called?


When the worker process is recycled, it is shut down, which means, yes,
Application_End will be called.
In addition, according to :
http://www.codecomments.com/archive2...-2-393853.html one can
understand that Application_End may not be able to finish its execution
before the process is shut-down. That does not sound reasonable to me.
What d'you say?


Well, Scott *is* an MVP, but first, to be fair, he didn't state
authoritatively that he knew how much time the process would have to shut
down. He guessed.

I'm not surprised that he guessed either. It took me over an hour to run
down this information for you. Luckily, it's Sunday! Here's the straight
dope:

When the ASP.Net worker process is shut down, there is a time limit set on
how long the server will wait before shutting down the process. How this
time limit is set on an IIS 6 box depends upon the execution model being
used for ASP.Net. By default, ASP.Net apps run in IIS 5 "Worker Process
Isolation Mode." This means that each worker process is run in an IIS 6.0
Application pool. The "Health" tab of the Application Pool Properties
dialog box is used to set the "Shutdown Time Limit" for that pool. This
corresponds to the "shutdowntimeout" value in the <processmodel> section
of the machine.config file, which is used in IIS 5 for all ASP.Net
applications, and in IIS 6 ASP.Net applications running in "IIS 5.0
Isolation Mode."

It should be noted, of course, that one cannot guarantee that the code in
the Application_End method of the global.asax class will complete before
the time limit is reached. Good programming practice would dictate that
you handle the eventuality that it doesn't. Bottom line is, whenever you
use memory to cache data, make sure to account for the eventuality that
the data will disappear for one reason or another.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
We got a sick zebra a hat,
you ultimate tuna.
"Ido" <id*@tgs-systems.com> wrote in message
news:Oc***************@TK2MSFTNGP14.phx.gbl...
Hi,
If asp process is being recycled/restarted gracefully, will
Application_End allways be called?
In addition, according to :
http://www.codecomments.com/archive2...-2-393853.html one can
understand that Application_End may not be able to finish its execution
before the process is shut-down. That does not sound reasonable to me.
What d'you say?

Thanks,
Ido


Feb 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Pedro Duque | last post by:
I've created a .net web service in c#. When there is no open session i need to free some resources. So, I've place the code on the Global.Application_End member. Unffortunatly it seems that the...
0
by: sushi | last post by:
Hello, When is Application_End event called? Actually, I am developing a web application which will start some operation that will continue to run even when the session of all the user's end...
3
by: Jim Owen | last post by:
My .Net book states that the Application_End event handler in Global.asax gets called typically about 20 minutes after the last HTTP request. My question is: what is the best way to debug my...
8
by: Alphonse Giambrone | last post by:
I have a small asp.net web app running on a shared host. It uses a Jet (Access) database. I included a routine to compact the database when the application_event fires if it has not been compacted...
4
by: Vlad Hrybok | last post by:
I am using Application_End to send out a notification about application being unloaded. I found that those notifications are not being sent because the app seems to get unloaded without...
4
by: J-T | last post by:
I have my applciation installed in an appplication pool (a worker process) -IIS 6.0-which is defined to be shut down after 20 minutes of being idle.If I put a breakpoint in Application_End method...
1
by: Navin Mishra | last post by:
Hi, If IIS Application Pool for a web service is called, shouldn't Application_End be called ? Some how I'm not seeing that. I've cached some client connection in Application object and I want...
0
by: Stonie | last post by:
Hi All, I have an asp.net web application that needs to clean up some worker threads on application shutdown. These threads are emptying an in memory buffer of messages to disk. Basically I...
5
by: Tenacious | last post by:
I am trying to shutdown a database server in the Application_End event handler on the Global.asax page. So far I am trying this only on the development server that comes with Visual Studio 2005....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.