473,795 Members | 3,151 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 3282
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
3195
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
1850
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
16130
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
1855
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
3052
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
2103
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
5201
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
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
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
7540
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
6780
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
5437
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
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
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
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.