Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Session Stage\Variables

Reply
Thread Tools

Session Stage\Variables

 
 
Rick
Guest
Posts: n/a
 
      09-27-2007
We are in the process of testing a large web project that I converted from
VS 2003 to VS 2005. Everything seems to be working except for a few minor
things. But the main issue I have is this, I have about 5 or 6 developers
testing this web site in a staging environment on a Microsoft 2003 Server
box. We have a base page that gets called on every page and checks for
session variables. After about 20 - 30 minutes these session variables are
getting cleared out and throwing an "object reference not set to an instance
of an object" error, this is due to the session variable all of sudden no
longer exists, This was not an issue with 2003.

I have sessionstate enabled and set to timeout at 20. My understanding is it
shouldn't time out for everyone at the same time and should time out if the
session is active.

Leading up to the time the error shows, I get this error in the eventlog:

Event Type: Information
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1314
Date: 9/27/2007
Time: 1:48:01 PM
User: N/A
Computer: STAGE1
Description:
Event code: 4011
Event message: An unhandled access exception has occurred.
Event time: 9/27/2007 1:48:01 PM
Event time (UTC): 9/27/2007 6:48:01 PM
Event ID: e491a210450c499da175a8f79bda9e4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
Machine name: STAGE1

Process information:
Process ID: 6300
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE

Custom event details:

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

Any suggestions?

Thanks in advance!
Rick


 
Reply With Quote
 
 
 
 
Robbe Morris - [MVP] C#
Guest
Posts: n/a
 
      09-27-2007
You set the timeout for 20 minutes and you say it starts throwing errors
after 20 minutes? Uh, isn't that what you would expect?

Also, why aren't you trapping for the existance of the session variable
prior to trying to access it? That has been an issue since for over
6 years now. That's not new in .NET 2.0.

You could also paste this in your global.asax and log the
error.

using System.Diagnostics;

protected void Application_Error(object sender, EventArgs e)
{
Exception objErr = Server.GetLastError().GetBaseException();
string err = "Error Caught in Application_Error event\n" +
"Error in: " + Request.Url.ToString() +
"\nError Message:" + objErr.Message.ToString()+
"\nStack Trace:" + objErr.StackTrace.ToString();
EventLog.WriteEntry("Sample_WebApp",err,EventLogEn tryType.Error);
Server.ClearError();
//additional actions...
}

You may have an unhandled error somewhere in the app
that is causing IIS to shutdown the app pool (which will kill
InProc Session) and restart it.

--
Robbe Morris [Microsoft MVP - Visual C#]
..NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials...d-control.aspx




"Rick" <(E-Mail Removed)> wrote in message
news:O%(E-Mail Removed)...
> We are in the process of testing a large web project that I converted from
> VS 2003 to VS 2005. Everything seems to be working except for a few minor
> things. But the main issue I have is this, I have about 5 or 6 developers
> testing this web site in a staging environment on a Microsoft 2003 Server
> box. We have a base page that gets called on every page and checks for
> session variables. After about 20 - 30 minutes these session variables are
> getting cleared out and throwing an "object reference not set to an
> instance of an object" error, this is due to the session variable all of
> sudden no longer exists, This was not an issue with 2003.
>
> I have sessionstate enabled and set to timeout at 20. My understanding is
> it shouldn't time out for everyone at the same time and should time out if
> the session is active.
>
> Leading up to the time the error shows, I get this error in the eventlog:
>
> Event Type: Information
> Event Source: ASP.NET 2.0.50727.0
> Event Category: Web Event
> Event ID: 1314
> Date: 9/27/2007
> Time: 1:48:01 PM
> User: N/A
> Computer: STAGE1
> Description:
> Event code: 4011
> Event message: An unhandled access exception has occurred.
> Event time: 9/27/2007 1:48:01 PM
> Event time (UTC): 9/27/2007 6:48:01 PM
> Event ID: e491a210450c499da175a8f79bda9e4e
> Event sequence: 1342
> Event occurrence: 6
> Event detail code: 0
>
> Application information:
> Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
> Trust level: Full
> Application Virtual Path: /
> Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
> Machine name: STAGE1
>
> Process information:
> Process ID: 6300
> Process name: w3wp.exe
> Account name: NT AUTHORITY\NETWORK SERVICE
>
> Request information:
> Request URL:
> Request path:
> User host address:
> User:
> Is authenticated: False
> Authentication Type:
> Thread account name: NT AUTHORITY\NETWORK SERVICE
>
> Custom event details:
>
> For more information, see Help and Support Center at
> http://go.microsoft.com/fwlink/events.asp.
>
> Any suggestions?
>
> Thanks in advance!
> Rick
>


 
Reply With Quote
 
 
 
 
George Ter-Saakov
Guest
Posts: n/a
 
      09-27-2007
The main difference between .NET 1.1 and .NET 2.0 (VS 2003 and VS 2005) is
that if you had a worker thread and it throws unhandled exception then the
whole process is terminated. It was not the case with .NET 1.1

In IIS environment the process is restarted instead of simple shutdown but
Session variables are lost and exception (similar to yours) is logged into
NT event log.

So look if you have a worker threads and enclose them into try.. catch...

PS: worker threads are the ones that you created yourself. Normal flow of
ASP.NET pages are normal threads and ASP.NET aware of them and catches all
exception thrown for you.


George.





"Rick" <(E-Mail Removed)> wrote in message
news:O%(E-Mail Removed)...
> We are in the process of testing a large web project that I converted from
> VS 2003 to VS 2005. Everything seems to be working except for a few minor
> things. But the main issue I have is this, I have about 5 or 6 developers
> testing this web site in a staging environment on a Microsoft 2003 Server
> box. We have a base page that gets called on every page and checks for
> session variables. After about 20 - 30 minutes these session variables are
> getting cleared out and throwing an "object reference not set to an
> instance of an object" error, this is due to the session variable all of
> sudden no longer exists, This was not an issue with 2003.
>
> I have sessionstate enabled and set to timeout at 20. My understanding is
> it shouldn't time out for everyone at the same time and should time out if
> the session is active.
>
> Leading up to the time the error shows, I get this error in the eventlog:
>
> Event Type: Information
> Event Source: ASP.NET 2.0.50727.0
> Event Category: Web Event
> Event ID: 1314
> Date: 9/27/2007
> Time: 1:48:01 PM
> User: N/A
> Computer: STAGE1
> Description:
> Event code: 4011
> Event message: An unhandled access exception has occurred.
> Event time: 9/27/2007 1:48:01 PM
> Event time (UTC): 9/27/2007 6:48:01 PM
> Event ID: e491a210450c499da175a8f79bda9e4e
> Event sequence: 1342
> Event occurrence: 6
> Event detail code: 0
>
> Application information:
> Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
> Trust level: Full
> Application Virtual Path: /
> Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
> Machine name: STAGE1
>
> Process information:
> Process ID: 6300
> Process name: w3wp.exe
> Account name: NT AUTHORITY\NETWORK SERVICE
>
> Request information:
> Request URL:
> Request path:
> User host address:
> User:
> Is authenticated: False
> Authentication Type:
> Thread account name: NT AUTHORITY\NETWORK SERVICE
>
> Custom event details:
>
> For more information, see Help and Support Center at
> http://go.microsoft.com/fwlink/events.asp.
>
> Any suggestions?
>
> Thanks in advance!
> Rick
>



 
Reply With Quote
 
Robbe Morris - [MVP] C#
Guest
Posts: n/a
 
      09-27-2007
True. One possiblity "might" be Server.Transfer and Response.Redirect
and not using a return statement right afterwards.

Response.Redirect("blah.aspx",false);
return;

I've seen this throw exceptions if the return line is missing.



--
Robbe Morris [Microsoft MVP - Visual C#]
..NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials...d-control.aspx




"George Ter-Saakov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The main difference between .NET 1.1 and .NET 2.0 (VS 2003 and VS 2005) is
> that if you had a worker thread and it throws unhandled exception then the
> whole process is terminated. It was not the case with .NET 1.1
>
> In IIS environment the process is restarted instead of simple shutdown but
> Session variables are lost and exception (similar to yours) is logged into
> NT event log.
>
> So look if you have a worker threads and enclose them into try.. catch...
>
> PS: worker threads are the ones that you created yourself. Normal flow of
> ASP.NET pages are normal threads and ASP.NET aware of them and catches all
> exception thrown for you.
>
>
> George.
>
>
>
>
>
> "Rick" <(E-Mail Removed)> wrote in message
> news:O%(E-Mail Removed)...
>> We are in the process of testing a large web project that I converted
>> from VS 2003 to VS 2005. Everything seems to be working except for a few
>> minor things. But the main issue I have is this, I have about 5 or 6
>> developers testing this web site in a staging environment on a Microsoft
>> 2003 Server box. We have a base page that gets called on every page and
>> checks for session variables. After about 20 - 30 minutes these session
>> variables are getting cleared out and throwing an "object reference not
>> set to an instance of an object" error, this is due to the session
>> variable all of sudden no longer exists, This was not an issue with 2003.
>>
>> I have sessionstate enabled and set to timeout at 20. My understanding is
>> it shouldn't time out for everyone at the same time and should time out
>> if the session is active.
>>
>> Leading up to the time the error shows, I get this error in the eventlog:
>>
>> Event Type: Information
>> Event Source: ASP.NET 2.0.50727.0
>> Event Category: Web Event
>> Event ID: 1314
>> Date: 9/27/2007
>> Time: 1:48:01 PM
>> User: N/A
>> Computer: STAGE1
>> Description:
>> Event code: 4011
>> Event message: An unhandled access exception has occurred.
>> Event time: 9/27/2007 1:48:01 PM
>> Event time (UTC): 9/27/2007 6:48:01 PM
>> Event ID: e491a210450c499da175a8f79bda9e4e
>> Event sequence: 1342
>> Event occurrence: 6
>> Event detail code: 0
>>
>> Application information:
>> Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
>> Trust level: Full
>> Application Virtual Path: /
>> Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
>> Machine name: STAGE1
>>
>> Process information:
>> Process ID: 6300
>> Process name: w3wp.exe
>> Account name: NT AUTHORITY\NETWORK SERVICE
>>
>> Request information:
>> Request URL:
>> Request path:
>> User host address:
>> User:
>> Is authenticated: False
>> Authentication Type:
>> Thread account name: NT AUTHORITY\NETWORK SERVICE
>>
>> Custom event details:
>>
>> For more information, see Help and Support Center at
>> http://go.microsoft.com/fwlink/events.asp.
>>
>> Any suggestions?
>>
>> Thanks in advance!
>> Rick
>>

>
>


 
Reply With Quote
 
George Ter-Saakov
Guest
Posts: n/a
 
      09-27-2007
I do not believe that it throws an unhandled exception.
It will not terminate the process.
Might give the user an error message but sessions will be intact.

George.


"Robbe Morris - [MVP] C#" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> True. One possiblity "might" be Server.Transfer and Response.Redirect
> and not using a return statement right afterwards.
>
> Response.Redirect("blah.aspx",false);
> return;
>
> I've seen this throw exceptions if the return line is missing.
>
>
>
> --
> Robbe Morris [Microsoft MVP - Visual C#]
> .NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
> http://www.eggheadcafe.com/tutorials...d-control.aspx
>
>
>
>
> "George Ter-Saakov" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> The main difference between .NET 1.1 and .NET 2.0 (VS 2003 and VS 2005)
>> is that if you had a worker thread and it throws unhandled exception then
>> the whole process is terminated. It was not the case with .NET 1.1
>>
>> In IIS environment the process is restarted instead of simple shutdown
>> but Session variables are lost and exception (similar to yours) is logged
>> into NT event log.
>>
>> So look if you have a worker threads and enclose them into try.. catch...
>>
>> PS: worker threads are the ones that you created yourself. Normal flow of
>> ASP.NET pages are normal threads and ASP.NET aware of them and catches
>> all exception thrown for you.
>>
>>
>> George.
>>
>>
>>
>>
>>
>> "Rick" <(E-Mail Removed)> wrote in message
>> news:O%(E-Mail Removed)...
>>> We are in the process of testing a large web project that I converted
>>> from VS 2003 to VS 2005. Everything seems to be working except for a few
>>> minor things. But the main issue I have is this, I have about 5 or 6
>>> developers testing this web site in a staging environment on a Microsoft
>>> 2003 Server box. We have a base page that gets called on every page and
>>> checks for session variables. After about 20 - 30 minutes these session
>>> variables are getting cleared out and throwing an "object reference not
>>> set to an instance of an object" error, this is due to the session
>>> variable all of sudden no longer exists, This was not an issue with
>>> 2003.
>>>
>>> I have sessionstate enabled and set to timeout at 20. My understanding
>>> is it shouldn't time out for everyone at the same time and should time
>>> out if the session is active.
>>>
>>> Leading up to the time the error shows, I get this error in the
>>> eventlog:
>>>
>>> Event Type: Information
>>> Event Source: ASP.NET 2.0.50727.0
>>> Event Category: Web Event
>>> Event ID: 1314
>>> Date: 9/27/2007
>>> Time: 1:48:01 PM
>>> User: N/A
>>> Computer: STAGE1
>>> Description:
>>> Event code: 4011
>>> Event message: An unhandled access exception has occurred.
>>> Event time: 9/27/2007 1:48:01 PM
>>> Event time (UTC): 9/27/2007 6:48:01 PM
>>> Event ID: e491a210450c499da175a8f79bda9e4e
>>> Event sequence: 1342
>>> Event occurrence: 6
>>> Event detail code: 0
>>>
>>> Application information:
>>> Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
>>> Trust level: Full
>>> Application Virtual Path: /
>>> Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
>>> Machine name: STAGE1
>>>
>>> Process information:
>>> Process ID: 6300
>>> Process name: w3wp.exe
>>> Account name: NT AUTHORITY\NETWORK SERVICE
>>>
>>> Request information:
>>> Request URL:
>>> Request path:
>>> User host address:
>>> User:
>>> Is authenticated: False
>>> Authentication Type:
>>> Thread account name: NT AUTHORITY\NETWORK SERVICE
>>>
>>> Custom event details:
>>>
>>> For more information, see Help and Support Center at
>>> http://go.microsoft.com/fwlink/events.asp.
>>>
>>> Any suggestions?
>>>
>>> Thanks in advance!
>>> Rick
>>>

>>
>>

>



 
Reply With Quote
 
Robbe Morris - [MVP] C#
Guest
Posts: n/a
 
      09-27-2007
It throws thread abort exceptions.

--
Robbe Morris [Microsoft MVP - Visual C#]
..NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials...d-control.aspx




"George Ter-Saakov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I do not believe that it throws an unhandled exception.
> It will not terminate the process.
> Might give the user an error message but sessions will be intact.
>
> George.
>
>
> "Robbe Morris - [MVP] C#" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> True. One possiblity "might" be Server.Transfer and Response.Redirect
>> and not using a return statement right afterwards.
>>
>> Response.Redirect("blah.aspx",false);
>> return;
>>
>> I've seen this throw exceptions if the return line is missing.
>>
>>
>>
>> --
>> Robbe Morris [Microsoft MVP - Visual C#]
>> .NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
>> http://www.eggheadcafe.com/tutorials...d-control.aspx
>>
>>
>>
>>
>> "George Ter-Saakov" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> The main difference between .NET 1.1 and .NET 2.0 (VS 2003 and VS 2005)
>>> is that if you had a worker thread and it throws unhandled exception
>>> then the whole process is terminated. It was not the case with .NET 1.1
>>>
>>> In IIS environment the process is restarted instead of simple shutdown
>>> but Session variables are lost and exception (similar to yours) is
>>> logged into NT event log.
>>>
>>> So look if you have a worker threads and enclose them into try..
>>> catch...
>>>
>>> PS: worker threads are the ones that you created yourself. Normal flow
>>> of ASP.NET pages are normal threads and ASP.NET aware of them and
>>> catches all exception thrown for you.
>>>
>>>
>>> George.
>>>
>>>
>>>
>>>
>>>
>>> "Rick" <(E-Mail Removed)> wrote in message
>>> news:O%(E-Mail Removed)...
>>>> We are in the process of testing a large web project that I converted
>>>> from VS 2003 to VS 2005. Everything seems to be working except for a
>>>> few minor things. But the main issue I have is this, I have about 5 or
>>>> 6 developers testing this web site in a staging environment on a
>>>> Microsoft 2003 Server box. We have a base page that gets called on
>>>> every page and checks for session variables. After about 20 - 30
>>>> minutes these session variables are getting cleared out and throwing an
>>>> "object reference not set to an instance of an object" error, this is
>>>> due to the session variable all of sudden no longer exists, This was
>>>> not an issue with 2003.
>>>>
>>>> I have sessionstate enabled and set to timeout at 20. My understanding
>>>> is it shouldn't time out for everyone at the same time and should time
>>>> out if the session is active.
>>>>
>>>> Leading up to the time the error shows, I get this error in the
>>>> eventlog:
>>>>
>>>> Event Type: Information
>>>> Event Source: ASP.NET 2.0.50727.0
>>>> Event Category: Web Event
>>>> Event ID: 1314
>>>> Date: 9/27/2007
>>>> Time: 1:48:01 PM
>>>> User: N/A
>>>> Computer: STAGE1
>>>> Description:
>>>> Event code: 4011
>>>> Event message: An unhandled access exception has occurred.
>>>> Event time: 9/27/2007 1:48:01 PM
>>>> Event time (UTC): 9/27/2007 6:48:01 PM
>>>> Event ID: e491a210450c499da175a8f79bda9e4e
>>>> Event sequence: 1342
>>>> Event occurrence: 6
>>>> Event detail code: 0
>>>>
>>>> Application information:
>>>> Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
>>>> Trust level: Full
>>>> Application Virtual Path: /
>>>> Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
>>>> Machine name: STAGE1
>>>>
>>>> Process information:
>>>> Process ID: 6300
>>>> Process name: w3wp.exe
>>>> Account name: NT AUTHORITY\NETWORK SERVICE
>>>>
>>>> Request information:
>>>> Request URL:
>>>> Request path:
>>>> User host address:
>>>> User:
>>>> Is authenticated: False
>>>> Authentication Type:
>>>> Thread account name: NT AUTHORITY\NETWORK SERVICE
>>>>
>>>> Custom event details:
>>>>
>>>> For more information, see Help and Support Center at
>>>> http://go.microsoft.com/fwlink/events.asp.
>>>>
>>>> Any suggestions?
>>>>
>>>> Thanks in advance!
>>>> Rick
>>>>
>>>
>>>

>>

>
>


 
Reply With Quote
 
George Ter-Saakov
Guest
Posts: n/a
 
      09-27-2007
But it's not unhandled.....
it's catched inside of ASP.NET framework...

am i right? Only unhandled, ie the ones that go without catch, are
dangerous.


George.

"Robbe Morris - [MVP] C#" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> It throws thread abort exceptions.
>
> --
> Robbe Morris [Microsoft MVP - Visual C#]
> .NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
> http://www.eggheadcafe.com/tutorials...d-control.aspx
>
>
>
>
> "George Ter-Saakov" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I do not believe that it throws an unhandled exception.
>> It will not terminate the process.
>> Might give the user an error message but sessions will be intact.
>>
>> George.
>>
>>
>> "Robbe Morris - [MVP] C#" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>> True. One possiblity "might" be Server.Transfer and Response.Redirect
>>> and not using a return statement right afterwards.
>>>
>>> Response.Redirect("blah.aspx",false);
>>> return;
>>>
>>> I've seen this throw exceptions if the return line is missing.
>>>
>>>
>>>
>>> --
>>> Robbe Morris [Microsoft MVP - Visual C#]
>>> .NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
>>> http://www.eggheadcafe.com/tutorials...d-control.aspx
>>>
>>>
>>>
>>>
>>> "George Ter-Saakov" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> The main difference between .NET 1.1 and .NET 2.0 (VS 2003 and VS 2005)
>>>> is that if you had a worker thread and it throws unhandled exception
>>>> then the whole process is terminated. It was not the case with .NET 1.1
>>>>
>>>> In IIS environment the process is restarted instead of simple shutdown
>>>> but Session variables are lost and exception (similar to yours) is
>>>> logged into NT event log.
>>>>
>>>> So look if you have a worker threads and enclose them into try..
>>>> catch...
>>>>
>>>> PS: worker threads are the ones that you created yourself. Normal flow
>>>> of ASP.NET pages are normal threads and ASP.NET aware of them and
>>>> catches all exception thrown for you.
>>>>
>>>>
>>>> George.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> "Rick" <(E-Mail Removed)> wrote in message
>>>> news:O%(E-Mail Removed)...
>>>>> We are in the process of testing a large web project that I converted
>>>>> from VS 2003 to VS 2005. Everything seems to be working except for a
>>>>> few minor things. But the main issue I have is this, I have about 5 or
>>>>> 6 developers testing this web site in a staging environment on a
>>>>> Microsoft 2003 Server box. We have a base page that gets called on
>>>>> every page and checks for session variables. After about 20 - 30
>>>>> minutes these session variables are getting cleared out and throwing
>>>>> an "object reference not set to an instance of an object" error, this
>>>>> is due to the session variable all of sudden no longer exists, This
>>>>> was not an issue with 2003.
>>>>>
>>>>> I have sessionstate enabled and set to timeout at 20. My understanding
>>>>> is it shouldn't time out for everyone at the same time and should time
>>>>> out if the session is active.
>>>>>
>>>>> Leading up to the time the error shows, I get this error in the
>>>>> eventlog:
>>>>>
>>>>> Event Type: Information
>>>>> Event Source: ASP.NET 2.0.50727.0
>>>>> Event Category: Web Event
>>>>> Event ID: 1314
>>>>> Date: 9/27/2007
>>>>> Time: 1:48:01 PM
>>>>> User: N/A
>>>>> Computer: STAGE1
>>>>> Description:
>>>>> Event code: 4011
>>>>> Event message: An unhandled access exception has occurred.
>>>>> Event time: 9/27/2007 1:48:01 PM
>>>>> Event time (UTC): 9/27/2007 6:48:01 PM
>>>>> Event ID: e491a210450c499da175a8f79bda9e4e
>>>>> Event sequence: 1342
>>>>> Event occurrence: 6
>>>>> Event detail code: 0
>>>>>
>>>>> Application information:
>>>>> Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
>>>>> Trust level: Full
>>>>> Application Virtual Path: /
>>>>> Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
>>>>> Machine name: STAGE1
>>>>>
>>>>> Process information:
>>>>> Process ID: 6300
>>>>> Process name: w3wp.exe
>>>>> Account name: NT AUTHORITY\NETWORK SERVICE
>>>>>
>>>>> Request information:
>>>>> Request URL:
>>>>> Request path:
>>>>> User host address:
>>>>> User:
>>>>> Is authenticated: False
>>>>> Authentication Type:
>>>>> Thread account name: NT AUTHORITY\NETWORK SERVICE
>>>>>
>>>>> Custom event details:
>>>>>
>>>>> For more information, see Help and Support Center at
>>>>> http://go.microsoft.com/fwlink/events.asp.
>>>>>
>>>>> Any suggestions?
>>>>>
>>>>> Thanks in advance!
>>>>> Rick
>>>>>
>>>>
>>>>
>>>

>>
>>

>



 
Reply With Quote
 
Rick
Guest
Posts: n/a
 
      09-27-2007
Thanks for the input!
Here is one thing I discovered with the code(by the way I didn't write this
it was inherted from other developers who are no longer here).
We have a data layer that accepts queries and excecutes them etc ...
Within this data layer the exceptions are handled and logged to the event
log. within the try catch after logging the exception, the code throws a new
exception to bubble up to the calling class, this is were I am getting an
unhandled exception error. So, this worked in 1.1 and bubbled the exception
but now it doesn't in 2.0. What is the correct way to accomplish this?

Sample Code:

Try
runSQL(SQL)
Catch EX as exception
logexceptionfromDatalayer(EX)
End Try


Public Function runSQL(ByVal SQL As String) As Boolean

Try

execute the query here

Catch ExceptionObject As Exception

logexception(ExceptionObject )

Throw New Exception("DataLayerName", ExceptionObject)

Finally

'Clean up

End Try

End Function




"George Ter-Saakov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The main difference between .NET 1.1 and .NET 2.0 (VS 2003 and VS 2005) is
> that if you had a worker thread and it throws unhandled exception then the
> whole process is terminated. It was not the case with .NET 1.1
>
> In IIS environment the process is restarted instead of simple shutdown but
> Session variables are lost and exception (similar to yours) is logged into
> NT event log.
>
> So look if you have a worker threads and enclose them into try.. catch...
>
> PS: worker threads are the ones that you created yourself. Normal flow of
> ASP.NET pages are normal threads and ASP.NET aware of them and catches all
> exception thrown for you.
>
>
> George.
>
>
>
>
>
> "Rick" <(E-Mail Removed)> wrote in message
> news:O%(E-Mail Removed)...
>> We are in the process of testing a large web project that I converted
>> from VS 2003 to VS 2005. Everything seems to be working except for a few
>> minor things. But the main issue I have is this, I have about 5 or 6
>> developers testing this web site in a staging environment on a Microsoft
>> 2003 Server box. We have a base page that gets called on every page and
>> checks for session variables. After about 20 - 30 minutes these session
>> variables are getting cleared out and throwing an "object reference not
>> set to an instance of an object" error, this is due to the session
>> variable all of sudden no longer exists, This was not an issue with 2003.
>>
>> I have sessionstate enabled and set to timeout at 20. My understanding is
>> it shouldn't time out for everyone at the same time and should time out
>> if the session is active.
>>
>> Leading up to the time the error shows, I get this error in the eventlog:
>>
>> Event Type: Information
>> Event Source: ASP.NET 2.0.50727.0
>> Event Category: Web Event
>> Event ID: 1314
>> Date: 9/27/2007
>> Time: 1:48:01 PM
>> User: N/A
>> Computer: STAGE1
>> Description:
>> Event code: 4011
>> Event message: An unhandled access exception has occurred.
>> Event time: 9/27/2007 1:48:01 PM
>> Event time (UTC): 9/27/2007 6:48:01 PM
>> Event ID: e491a210450c499da175a8f79bda9e4e
>> Event sequence: 1342
>> Event occurrence: 6
>> Event detail code: 0
>>
>> Application information:
>> Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
>> Trust level: Full
>> Application Virtual Path: /
>> Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
>> Machine name: STAGE1
>>
>> Process information:
>> Process ID: 6300
>> Process name: w3wp.exe
>> Account name: NT AUTHORITY\NETWORK SERVICE
>>
>> Request information:
>> Request URL:
>> Request path:
>> User host address:
>> User:
>> Is authenticated: False
>> Authentication Type:
>> Thread account name: NT AUTHORITY\NETWORK SERVICE
>>
>> Custom event details:
>>
>> For more information, see Help and Support Center at
>> http://go.microsoft.com/fwlink/events.asp.
>>
>> Any suggestions?
>>
>> Thanks in advance!
>> Rick
>>

>
>



 
Reply With Quote
 
George Ter-Saakov
Guest
Posts: n/a
 
      09-27-2007
this is correct approach.
I am not sure why you saying it's not working...... I do not see any obvious
problem....

The only reason I might suggest is that your logexception is throwing some
other error so it actually never makes to your next statement
Throw New Exception("DataLayerName", ExceptionObject)


George.


"Rick" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Thanks for the input!
> Here is one thing I discovered with the code(by the way I didn't write
> this it was inherted from other developers who are no longer here).
> We have a data layer that accepts queries and excecutes them etc ...
> Within this data layer the exceptions are handled and logged to the event
> log. within the try catch after logging the exception, the code throws a
> new exception to bubble up to the calling class, this is were I am getting
> an unhandled exception error. So, this worked in 1.1 and bubbled the
> exception but now it doesn't in 2.0. What is the correct way to accomplish
> this?
>
> Sample Code:
>
> Try
> runSQL(SQL)
> Catch EX as exception
> logexceptionfromDatalayer(EX)
> End Try
>
>
> Public Function runSQL(ByVal SQL As String) As Boolean
>
> Try
>
> execute the query here
>
> Catch ExceptionObject As Exception
>
> logexception(ExceptionObject )
>
> Throw New Exception("DataLayerName", ExceptionObject)
>
> Finally
>
> 'Clean up
>
> End Try
>
> End Function
>
>
>
>
> "George Ter-Saakov" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> The main difference between .NET 1.1 and .NET 2.0 (VS 2003 and VS 2005)
>> is that if you had a worker thread and it throws unhandled exception then
>> the whole process is terminated. It was not the case with .NET 1.1
>>
>> In IIS environment the process is restarted instead of simple shutdown
>> but Session variables are lost and exception (similar to yours) is logged
>> into NT event log.
>>
>> So look if you have a worker threads and enclose them into try.. catch...
>>
>> PS: worker threads are the ones that you created yourself. Normal flow of
>> ASP.NET pages are normal threads and ASP.NET aware of them and catches
>> all exception thrown for you.
>>
>>
>> George.
>>
>>
>>
>>
>>
>> "Rick" <(E-Mail Removed)> wrote in message
>> news:O%(E-Mail Removed)...
>>> We are in the process of testing a large web project that I converted
>>> from VS 2003 to VS 2005. Everything seems to be working except for a few
>>> minor things. But the main issue I have is this, I have about 5 or 6
>>> developers testing this web site in a staging environment on a Microsoft
>>> 2003 Server box. We have a base page that gets called on every page and
>>> checks for session variables. After about 20 - 30 minutes these session
>>> variables are getting cleared out and throwing an "object reference not
>>> set to an instance of an object" error, this is due to the session
>>> variable all of sudden no longer exists, This was not an issue with
>>> 2003.
>>>
>>> I have sessionstate enabled and set to timeout at 20. My understanding
>>> is it shouldn't time out for everyone at the same time and should time
>>> out if the session is active.
>>>
>>> Leading up to the time the error shows, I get this error in the
>>> eventlog:
>>>
>>> Event Type: Information
>>> Event Source: ASP.NET 2.0.50727.0
>>> Event Category: Web Event
>>> Event ID: 1314
>>> Date: 9/27/2007
>>> Time: 1:48:01 PM
>>> User: N/A
>>> Computer: STAGE1
>>> Description:
>>> Event code: 4011
>>> Event message: An unhandled access exception has occurred.
>>> Event time: 9/27/2007 1:48:01 PM
>>> Event time (UTC): 9/27/2007 6:48:01 PM
>>> Event ID: e491a210450c499da175a8f79bda9e4e
>>> Event sequence: 1342
>>> Event occurrence: 6
>>> Event detail code: 0
>>>
>>> Application information:
>>> Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
>>> Trust level: Full
>>> Application Virtual Path: /
>>> Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
>>> Machine name: STAGE1
>>>
>>> Process information:
>>> Process ID: 6300
>>> Process name: w3wp.exe
>>> Account name: NT AUTHORITY\NETWORK SERVICE
>>>
>>> Request information:
>>> Request URL:
>>> Request path:
>>> User host address:
>>> User:
>>> Is authenticated: False
>>> Authentication Type:
>>> Thread account name: NT AUTHORITY\NETWORK SERVICE
>>>
>>> Custom event details:
>>>
>>> For more information, see Help and Support Center at
>>> http://go.microsoft.com/fwlink/events.asp.
>>>
>>> Any suggestions?
>>>
>>> Thanks in advance!
>>> Rick
>>>

>>
>>

>
>



 
Reply With Quote
 
Rick
Guest
Posts: n/a
 
      09-27-2007
I walked through the code line by line, It is making it to the next
statement, then as soon as it breaks on the finally it throws an Exception
was unhandled by user code error

"George Ter-Saakov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> this is correct approach.
> I am not sure why you saying it's not working...... I do not see any
> obvious problem....
>
> The only reason I might suggest is that your logexception is throwing some
> other error so it actually never makes to your next statement
> Throw New Exception("DataLayerName", ExceptionObject)
>
>
> George.
>
>
> "Rick" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Thanks for the input!
>> Here is one thing I discovered with the code(by the way I didn't write
>> this it was inherted from other developers who are no longer here).
>> We have a data layer that accepts queries and excecutes them etc ...
>> Within this data layer the exceptions are handled and logged to the event
>> log. within the try catch after logging the exception, the code throws a
>> new exception to bubble up to the calling class, this is were I am
>> getting an unhandled exception error. So, this worked in 1.1 and bubbled
>> the exception but now it doesn't in 2.0. What is the correct way to
>> accomplish this?
>>
>> Sample Code:
>>
>> Try
>> runSQL(SQL)
>> Catch EX as exception
>> logexceptionfromDatalayer(EX)
>> End Try
>>
>>
>> Public Function runSQL(ByVal SQL As String) As Boolean
>>
>> Try
>>
>> execute the query here
>>
>> Catch ExceptionObject As Exception
>>
>> logexception(ExceptionObject )
>>
>> Throw New Exception("DataLayerName", ExceptionObject)
>>
>> Finally
>>
>> 'Clean up
>>
>> End Try
>>
>> End Function
>>
>>
>>
>>
>> "George Ter-Saakov" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> The main difference between .NET 1.1 and .NET 2.0 (VS 2003 and VS 2005)
>>> is that if you had a worker thread and it throws unhandled exception
>>> then the whole process is terminated. It was not the case with .NET 1.1
>>>
>>> In IIS environment the process is restarted instead of simple shutdown
>>> but Session variables are lost and exception (similar to yours) is
>>> logged into NT event log.
>>>
>>> So look if you have a worker threads and enclose them into try..
>>> catch...
>>>
>>> PS: worker threads are the ones that you created yourself. Normal flow
>>> of ASP.NET pages are normal threads and ASP.NET aware of them and
>>> catches all exception thrown for you.
>>>
>>>
>>> George.
>>>
>>>
>>>
>>>
>>>
>>> "Rick" <(E-Mail Removed)> wrote in message
>>> news:O%(E-Mail Removed)...
>>>> We are in the process of testing a large web project that I converted
>>>> from VS 2003 to VS 2005. Everything seems to be working except for a
>>>> few minor things. But the main issue I have is this, I have about 5 or
>>>> 6 developers testing this web site in a staging environment on a
>>>> Microsoft 2003 Server box. We have a base page that gets called on
>>>> every page and checks for session variables. After about 20 - 30
>>>> minutes these session variables are getting cleared out and throwing an
>>>> "object reference not set to an instance of an object" error, this is
>>>> due to the session variable all of sudden no longer exists, This was
>>>> not an issue with 2003.
>>>>
>>>> I have sessionstate enabled and set to timeout at 20. My understanding
>>>> is it shouldn't time out for everyone at the same time and should time
>>>> out if the session is active.
>>>>
>>>> Leading up to the time the error shows, I get this error in the
>>>> eventlog:
>>>>
>>>> Event Type: Information
>>>> Event Source: ASP.NET 2.0.50727.0
>>>> Event Category: Web Event
>>>> Event ID: 1314
>>>> Date: 9/27/2007
>>>> Time: 1:48:01 PM
>>>> User: N/A
>>>> Computer: STAGE1
>>>> Description:
>>>> Event code: 4011
>>>> Event message: An unhandled access exception has occurred.
>>>> Event time: 9/27/2007 1:48:01 PM
>>>> Event time (UTC): 9/27/2007 6:48:01 PM
>>>> Event ID: e491a210450c499da175a8f79bda9e4e
>>>> Event sequence: 1342
>>>> Event occurrence: 6
>>>> Event detail code: 0
>>>>
>>>> Application information:
>>>> Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
>>>> Trust level: Full
>>>> Application Virtual Path: /
>>>> Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
>>>> Machine name: STAGE1
>>>>
>>>> Process information:
>>>> Process ID: 6300
>>>> Process name: w3wp.exe
>>>> Account name: NT AUTHORITY\NETWORK SERVICE
>>>>
>>>> Request information:
>>>> Request URL:
>>>> Request path:
>>>> User host address:
>>>> User:
>>>> Is authenticated: False
>>>> Authentication Type:
>>>> Thread account name: NT AUTHORITY\NETWORK SERVICE
>>>>
>>>> Custom event details:
>>>>
>>>> For more information, see Help and Support Center at
>>>> http://go.microsoft.com/fwlink/events.asp.
>>>>
>>>> Any suggestions?
>>>>
>>>> Thanks in advance!
>>>> Rick
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= ASP .Net 4 04-11-2007 04:52 PM
Unable to serialize the session state. Please note that non-serializable objects or MarshalByRef objects are not permitted when session state mode is 'StateServer' or 'SQLServer'. Mike Larkin ASP .Net 1 05-23-2005 12:33 PM
Session State - What does it take to establish one single ASP.NET session per "browser session" Jeff Smythe ASP .Net 3 01-02-2004 04:10 AM
How can I "know" the difference between a session timed out and a session that did session.abort? Jazzis ASP General 2 09-23-2003 07:16 AM
Which is faster? Dim dv As New DataView(session("myDataTable")) or CType(session("myDataTable")) Andreas Klemt ASP .Net 1 07-23-2003 12:18 AM



Advertisments