473,222 Members | 1,833 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,222 software developers and data experts.

detect when an app domain is being shut down

Hi,

We have HttpHandlers that can process requests for up to 50 minutes. Those
HttpHandlers are running in an app domain inside the DefaultAppPool. We'd
like the HttpHandlers to be able to detect when its containing app pool or
app domain is requesting a shutdown (when it is recycling, for example). I
looked at the Application_End method in global.asax, as well as the System.
AppDomain.CurrentDomain.DomainUnload event. Neither get called as long as
the HttpHandlers are handling a client request. Is there a way to
programatically know when an app domain is about to shut down? We need to
know so that we can force the request to end more quickly and gracefully.

Thanks for you help.

Bubba
Dec 11 '06 #1
5 4335
Hi,
I think this can be handled inside AppDomain.UnhandledException event.
If you want complete working code for it then please let me know.

Thanks and Regards,
mansih bafna

"Bubba" wrote:
Hi,

We have HttpHandlers that can process requests for up to 50 minutes. Those
HttpHandlers are running in an app domain inside the DefaultAppPool. We'd
like the HttpHandlers to be able to detect when its containing app pool or
app domain is requesting a shutdown (when it is recycling, for example). I
looked at the Application_End method in global.asax, as well as the System.
AppDomain.CurrentDomain.DomainUnload event. Neither get called as long as
the HttpHandlers are handling a client request. Is there a way to
programatically know when an app domain is about to shut down? We need to
know so that we can force the request to end more quickly and gracefully.

Thanks for you help.

Bubba
Dec 12 '06 #2
Hi,
Have you also tried AppDomain.ProcessExit?

Thanks and Regards,
manish bafna

"Bubba" wrote:
Hi,

We have HttpHandlers that can process requests for up to 50 minutes. Those
HttpHandlers are running in an app domain inside the DefaultAppPool. We'd
like the HttpHandlers to be able to detect when its containing app pool or
app domain is requesting a shutdown (when it is recycling, for example). I
looked at the Application_End method in global.asax, as well as the System.
AppDomain.CurrentDomain.DomainUnload event. Neither get called as long as
the HttpHandlers are handling a client request. Is there a way to
programatically know when an app domain is about to shut down? We need to
know so that we can force the request to end more quickly and gracefully.

Thanks for you help.

Bubba
Dec 12 '06 #3
Hi Manish,

Thanks for your input, but AppDomain.ProcessExit is not called while there
are requests running. Also, AppDomain.UnHandledException is not appropriate
because there are no exceptions thrown in this case.

Thanks,
Bubba
Dec 12 '06 #4
Since your http handlers are still executing you AppDomain will not shut
down so could you hook into any shutdown event?

Gabriel

"Bubba" <fa**@fake.fakewrote in message
news:f9******************************@ureader.com. ..
Hi,

We have HttpHandlers that can process requests for up to 50 minutes.
Those
HttpHandlers are running in an app domain inside the DefaultAppPool. We'd
like the HttpHandlers to be able to detect when its containing app pool or
app domain is requesting a shutdown (when it is recycling, for example).
I
looked at the Application_End method in global.asax, as well as the
System.
AppDomain.CurrentDomain.DomainUnload event. Neither get called as long as
the HttpHandlers are handling a client request. Is there a way to
programatically know when an app domain is about to shut down? We need to
know so that we can force the request to end more quickly and gracefully.

Thanks for you help.

Bubba

Dec 12 '06 #5
In essence, that is what I want to do - but I don't know where to do that.

Bubba
Dec 12 '06 #6

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

Similar topics

4
by: Claire | last post by:
Running XP pro, SP2. Visual studio .NET 2003. App written in C# I have written an application that hides itself when run and shows a notification icon in the system tray. If the main form is...
2
by: Mike Stephens | last post by:
I have an application to minimizes when X is clicked. If the user wants to close the application they click the Exit Application button.This works fine and does exactly what I need. I have since...
3
by: BrianDH | last post by:
Hi I have a VB.Net windows application that for some reason when running will not allow the user to shut-down/reboot the Operating System without first closing my application. Has anyone had the...
4
by: pamelafluente | last post by:
Hi Guys, I have a small application which uses a NotifyIcon. The user can set a flag (PreventClosing ) so that when he clicks on the form-cancel button "X", the program will instead be...
2
by: Jason S | last post by:
Hi there, I created a simple VB app that runs in the background that I now need to detect when Windows (XP with SP2) is just about to Shut Down OR the user is Logging Off. Is this possible? I...
7
by: mangesh | last post by:
Is there any function in standard library that can forcefully release memory associated with a process(application) ? Regards Mangesh .
0
by: Sidney | last post by:
Dear, I am writting a system which opened at the system tray. But every before I shut down my computer, I have to close the system first. However, it should be automatically close when I shutting...
8
by: Austen | last post by:
Hello i trying to shut down window using vb. i able to restart and log off, but was unable to shut down. when excute the shut down command , nothing happend. it related to window os security issue?
1
by: shubby | last post by:
hello, I have a same kind of problem, when i shut-down my system, it gets restarted, plz assist me how to correct that Thanks
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.