473,785 Members | 2,746 Online
Bytes | Software Development & Data Engineering Community
+ 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 3281
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 "shutdowntimeou t" 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******** *******@TK2MSFT NGP14.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***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:eS******** ******@TK2MSFTN GP11.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 "shutdowntimeou t" 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******** *******@TK2MSFT NGP14.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
3187
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 code is never executed (at least when i debug it). Help anyone?
0
1848
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 timeout's. I want to save the state of that operation when the IIS Server is stopped.
3
16127
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 Application_End code? I could of course add a button or something to a form to run the code explicitly, but I want to be sure it is really getting called after 20 minutes. I assume that if I put a breakpoint in my Application_End code, and then run the...
8
1854
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 for a certain period of time. A compact must be done into a new file. In other words mydb.mdb compacts into mydb2.mdb. The original file (mydb.mdb) then gets deleted and mydb2.mdb is renamed to mydb.mdb. This routine works fine on another shared...
4
9225
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 Application_End ever being called. We started logging Application_Start and Application_End events and found that the number is not even: Application_Start happen more often than Application_End. My question is: What are the sutuations in which we should...
4
3050
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 of Global.asax and there is no request for 20 minutes ,dose the breakpoint works for me? Is there a document which can gives me more infomration in this behaviour? Thanks
1
2101
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 to clear them in Application_End but I'm not able to. Thanks in advance and regards Navin
0
1302
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 want these threads to empty any remaining messages to disk before exiting. To do so, I'm calling a clean up method in Application_End()
5
5200
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. When I close the browser, this does not cause the Application_End event to trigger. It also will not occur when I shut down the development server. At this point the application is no longer running, so why didn't the event handler ever get called?...
0
9643
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10087
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7496
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2877
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.