Exceptions kill Sessions?

G

Guest

I'm working on a huge scale project, and I've stumbled onto something that
appeared to be just random buggy code before we started larger scale testing.

Everytime there is an exception in my code, the session is terminated. I
don't understand why this is. I can't find any reference to it in the
documentation, nor in my google searches so far.

This behaviour is crippling the entire project, I'd really appreciate some
information :(
 
P

Paul

Would probably need more information, but:

Is the exception safely handled?
Just as an idea, do you think that the session is killing the ASP.Net Worker
process? That would cause the application and therefore the session to
restart.
 
J

John Timney \( MVP \)

When an unhandled exception occurs in an asp.net application the current
session will be terminated and a new one will by default be started. So if
its being triggered by unhandled exceptions you need to implement an
application level exception handler.

Read about a solution here:

http://blogs.msdn.com/mattwag/archive/2005/02/07/368605.aspx

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
 
G

Guest

Ok, my exceptions, specifically the ones causing the session to terminate,
are not unhandled. While my exception handling isn't done on
Application_OnError, it is done using a try block.

Also, ~99.9% of my exceptions are being caught by my handlers, so unless
there is something extra I don't know about handling exceptions (quite
possible) then the problem is not an unhandled exception.

My exception handling routines involve placing the stacktrace and message
parts in a RegisterStartupScript block inside a simple javascript alert. This
is done inside a function so that at a later stage I can change it to a
logging mechanism.

Most of my exceptions are caused by database problems, bad sql etc.

Worst of all, I have my boss changing code of mine now because he thinks he
knows what's wrong :/ !!!
 
J

John Timney \( MVP \)

For five minutes work try adding an application level handler, specifically
the one in the blog entry........see if it makes a difference.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
 
G

Guest

No change I'm afraid.

John Timney ( MVP ) said:
For five minutes work try adding an application level handler, specifically
the one in the blog entry........see if it makes a difference.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
 
G

Guest

Well I'll be... there is an old piece of code in the system logging
exceptions to the bin directory....
 
J

John Timney \( MVP \)

does that mean you've solved it before your boss did?

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
 
G

Guest

That it does =) Though that's not too difficult, he only has a basic
knowledge of programming, so he was not likely to solve it anyway... and as
you probably know, that kind of person can be very dangerous when they start
modifying your code....
 
J

John Timney \( MVP \)

well I hope I helped, and when his job comes up for renewal let me
know.........lol
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top