473,663 Members | 2,694 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multithreading in Application_Err or event handler?

ram
Hi,

In Application_Err or (global.asax) i'm sending the details of the
exception to
a file (opening and closing file each time).

I'm using the same file (eg, log.txt) for all logs.

Are the calls to this method serialized?

It's possible that, when trying to write to the file, the file is
already opened by another thread?
TIA,
ram
Nov 18 '05 #1
1 1003

"ram" <ru********@hot mail.com> wrote in message
news:2f******** *************** ***@posting.goo gle.com...
Hi,

In Application_Err or (global.asax) i'm sending the details of the
exception to
a file (opening and closing file each time).

I'm using the same file (eg, log.txt) for all logs.

Are the calls to this method serialized?
In my experience, no.

It's possible that, when trying to write to the file, the file is
already opened by another thread?


Yes. If you want to write to the file from multiple threads, you need to
synchronize your code.

Regards,
Sami
Nov 18 '05 #2

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

Similar topics

1
3781
by: John Scott | last post by:
Hi there, I have an odd situation. I have exception handling set up in my Application_Error event handler in my global.asax. On my development box, errors get caught by the event handler fine and redirect the user to an error page manually...I know about the defaultRedirect but I'm just not using it. Now when I try to recreate an error on my production box, I get the standard asp.net error page with the big yellow bar accross the top...
3
3031
by: tafs7 | last post by:
My code below is supposed to email me when an error occurs on the application, but it's not emailing anything. Am I missing something? I know the smtp servers I've tried work. I even added a App_Start handler to see if I could get emailed at all even from the first request of the app, but to no avail. Could someone please help me out? Thanks a lot! --Thiago Web developer AgniTEK
3
3210
by: Mike Malter | last post by:
I have a general error page that I configured in web.config as <customErrors mode="On" defaultRedirect="CRDefaultError.aspx" /> This error page comes up whenever an error occurs outside of any try/catch blocks. This page has a text box in it that I would like to fill with relevant information about the error. I am trying to put the Server.GetLastError().ToString() in there. It did not work on the page, and I read somewhere that I should...
0
1073
by: Michael | last post by:
Hi, I have an ASP.NET application that catches un-handled exceptions in the Application_Error method and writes the details to the Event Log. But, if I do a Server.ClearError() followed by either a Server.Transfer or Response.Redirect to another ASP.NET page, then it causes .NET to re-enter the Application_Error function. I thought that maybe there is an exception being thrown in the Application_Error function, but after placing a...
0
968
by: Michael | last post by:
Hi, I have an ASP.NET application that catches un-handled exceptions in the Application_Error method and writes the details to the Event Log. But, if I do a Server.ClearError() followed by either a Server.Transfer or Response.Redirect to another ASP.NET page, then it causes .NET to re-enter the Application_Error function. I thought that maybe there is an exception being thrown in the Application_Error function, but after placing a...
2
2112
by: Carl Johansen | last post by:
I've been reading the O'Reilly "ASP.NET Cookbook" 1st edition (Kittel and LeBlond), and it makes a recommendation about exception handling that seems a bit strange. They say that, if you want to let some exceptions propagate up to Application_Error, you should include the following Page_Error on every page: Private Sub Page_Error(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Error Throw Server.GetLastError() End...
5
1635
by: Boni | last post by:
Dear all, picturebox mouse move seems to start new thread each time it is called. At least I see in debuger many threads. ---Non user code-- Picturebox.MouseMove This seems to spoil my algorithm. SyncLock Me Do() EndSyncloc
1
1850
by: David Herbst | last post by:
VS 2005 / .NET 2.0 Windows 2000 Server sp4 (on development as well as testing server) Using Web Deployment Project to build assemblies for testing and production servers. I added a Global.asax file to my web site so I could implement a Application_Error() handler. The handler works fine on my development web server but when I deploy it to the testing web server it doesn't execute. Instead I get the detailed ASP.NET error page or my...
10
2356
by: Nemisis | last post by:
Hi everyone, I am trying to create a custom error page, that the user gets shown when a error has occurred within my website. The code works perfectly, apart from when an invalid URL is typed in, then i am unable to pass the exception from the global.asax file to the page via the sessionstate. Everytime i try to pass something into the sessionstate i get a error message of 'Object reference not set to an instance of an object.'
1
8548
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
8634
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...
0
7371
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
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
5657
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
4182
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
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
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
1757
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.