473,473 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 3247
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.