473,396 Members | 2,154 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,396 software developers and data experts.

how to handle exception in a second thread in asp.net?

Hi,
I'm working on a multi-threading web application. I'm using
Application_Error event to write exception detail to windows event log
to help debug. It seems exception happened in the second thread doesn't
fire this event. I tried to use trace.write() method. It doesn't seem
work either. I'm out of idea.

Any help is highly appreciated.

Lucy

Nov 19 '05 #1
2 1846
multi thread asp.net apps is not usually a good idea as you can run into
scalling problems. if you start a thread, then its outside the asp.net
processing (as page processing is a asp.net thread calling a page method,
which uses a try/catch to implement Application_Error).

you background thread can write to the event log itself (it shoudl catch its
own errors). it could call back to the main thread, though you have to be
careful, as the main thread may switch during page processing. asp.net is
free to switch threads before calling a page methods like onload, onint, or
firing page events.

-- bruce (sqlwork.com)


"lucy" <yo****@profitecinc.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
Hi,
I'm working on a multi-threading web application. I'm using
Application_Error event to write exception detail to windows event log
to help debug. It seems exception happened in the second thread doesn't
fire this event. I tried to use trace.write() method. It doesn't seem
work either. I'm out of idea.

Any help is highly appreciated.

Lucy

Nov 19 '05 #2
Thank you bruce. It worked for me. I'm using the second thread for
email processing, since it's a really long process, I don't want to
hold the end user back. But there is one problem. How can I notify them
whether the process is successful or failure? As you said by the time
the second thread is complete, they may switch to other page already.

Any idea or direction?

thanks in advance.

Lucy

Nov 19 '05 #3

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

Similar topics

5
by: Anks | last post by:
hi I am displaying a digital clock in an applet.I am using Thread.sleep (1000) for counting every second.This works fine some times but some times my clock just slows down or give an...
3
by: Calvin Spealman | last post by:
I was wondering if it was possible, now or with a patch, to do either of the following: 1) Cause another thread's most recent function, or a given function in a given thread, to yield its...
1
by: Craig Ringer | last post by:
Hi folks I'm a bit of a newbie here, though I've tried to appropriately research this issue before posting. I've found a lot of questions, a few answers that don't really answer quite what I'm...
2
by: Mark Hoffman | last post by:
All, My application spawns a worker process by calling BeginInvoke with an asynchronous callback method. This callback method is responsible for calling EndInvoke. No problems there; pretty much...
17
by: ahaupt | last post by:
Hi all, I'm currently writing a load of class libraries, but not the main application iteslf. I want to provide some method for reporting errors back to the main application. At the moment...
6
by: Leandro Berti via DotNetMonster.com | last post by:
Hi All, I wrote a code to do serial communication with an equipament. When i use the code outside of threaded class it seens work properly, but when i put inside a class and execute a thread in...
2
by: Gary Wessle | last post by:
Hi I need help organizing this program in the right way. I included the code below which compiles and runs and gives the desired effect to a certain point, but I don't know what the next step...
2
by: Robinson | last post by:
Hi, I have 2 menu items on the Debug menu of my application: Throw Exception On Form and Throw Exception In Worker Thread The former just executes: throw new Exception ( "I'm testing...
0
by: =?Utf-8?B?aGVyYmVydA==?= | last post by:
I read from a serialport using a worker thread. Because the worker thread t does not loop often, I cannot wait to terminate the worker thread using a boolean in the While condition. So I have a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
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
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...

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.