Sessions timing out quickly despite very high timeout set in web.config

A

Alex

Hello,

We have a large asp.net writtin in VB.Net 2003, and for some reason the
sessions have started timing out very quickly, like 5-10 minutes in some
cases. In web.config we have the SessionState timeout set at 720 minutes,
but this doesn't seem to help.

What we're seeing is users working in the system just fine, then they'll get
the following error when the application tries to reference the session:

-[Begin Snippet]-------------------------------------
Server Error in '/' Application.

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.

Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
Sigma.DetailsReport.RetrieveData() in
C:\Inetpub\wwwroot\App\Loan\Details.aspx.vb:107
Sigma.DetailsReport.Page_Load(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\App\Loan\Details.aspx.vb:71
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750

Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
Version:1.1.4322.2300
-[End Snippet]-------------------------------------

When reviewing the code from the trace, it always is something that
references something in the Session, and my assumption is the session has
expired causing a null to be returned.

I'm fairly new to the world of VB, but being a seasoned web coder of other
languages I'm not sure exactly what to try next. I'm working on adding code
to detect the timeout and return something other then a .Net error, but this
still won't help the fact that our sessions are timing out in a matter of
minutes when they shouldn't be.

Thanks in advance for any advise or suggestions on this --

Alex
 
G

Guest

It might be the Session is expired, or it could just be that the object
attempting to be referenced is null ("Nothing in VB.NET").

I see 2 things you might do to help improve things:
1) Set Option Explicit and Option Strict to "on". This at least attempts to
put you on a level playing field with us C# folks.
2) Wire up your app with unhandled exception handling and logging in your
Application_Error handler in global.asax.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com



Alex said:
Hello,

We have a large asp.net writtin in VB.Net 2003, and for some reason the
sessions have started timing out very quickly, like 5-10 minutes in some
cases. In web.config we have the SessionState timeout set at 720 minutes,
but this doesn't seem to help.

What we're seeing is users working in the system just fine, then they'll get
the following error when the application tries to reference the session:

-[Begin Snippet]-------------------------------------
Server Error in '/' Application.

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.

Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
Sigma.DetailsReport.RetrieveData() in
C:\Inetpub\wwwroot\App\Loan\Details.aspx.vb:107
Sigma.DetailsReport.Page_Load(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\App\Loan\Details.aspx.vb:71
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750

Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
Version:1.1.4322.2300
-[End Snippet]-------------------------------------

When reviewing the code from the trace, it always is something that
references something in the Session, and my assumption is the session has
expired causing a null to be returned.

I'm fairly new to the world of VB, but being a seasoned web coder of other
languages I'm not sure exactly what to try next. I'm working on adding code
to detect the timeout and return something other then a .Net error, but this
still won't help the fact that our sessions are timing out in a matter of
minutes when they shouldn't be.

Thanks in advance for any advise or suggestions on this --

Alex
 
B

bruce barker

check the event log (on the iis box) for recycle events. these will
happen if your site uses too much memory (large sessions, memory leaks,
etc) or has hanging threads.

if your app is not written to gracefully handle a lost session, then you
should not use inproc sessions.

-- bruce (sqlwork.com)
 
J

Juan T. Llibre

You might want to look into what is causing your applications to recycle.

An easy way to do this is to implement Scott Guthrie's
tips for logging ASP.NET application shutdown events :

http://weblogs.asp.net/scottgu/archive/2005/12/14/433194.aspx

By using this diagnostics tool, you can figure out why and when ASP.NET restarts application domains.





Alex said:
Hello,

We have a large asp.net writtin in VB.Net 2003, and for some reason the sessions have started timing out very quickly,
like 5-10 minutes in some cases. In web.config we have the SessionState timeout set at 720 minutes, but this doesn't
seem to help.

What we're seeing is users working in the system just fine, then they'll get the following error when the application
tries to reference the session:

-[Begin Snippet]-------------------------------------
Server Error in '/' Application.

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack
trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin
and location of the exception can be identified using the exception stack trace below.

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Sigma.DetailsReport.RetrieveData() in C:\Inetpub\wwwroot\App\Loan\Details.aspx.vb:107
Sigma.DetailsReport.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\App\Loan\Details.aspx.vb:71
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750

Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
-[End Snippet]-------------------------------------

When reviewing the code from the trace, it always is something that references something in the Session, and my
assumption is the session has expired causing a null to be returned.

I'm fairly new to the world of VB, but being a seasoned web coder of other languages I'm not sure exactly what to try
next. I'm working on adding code to detect the timeout and return something other then a .Net error, but this still
won't help the fact that our sessions are timing out in a matter of minutes when they shouldn't be.

Thanks in advance for any advise or suggestions on this --

Alex
 
A

Alex

Hi Bruce,

Actually I hadn't thought about checking the server event log... I did so
and noticed several errors like this:

Event Type: Information
Event Source: W3SVC
Event Category: None
Event ID: 1117
Date: 8/24/2007
Time: 12:43:20 PM
User: N/A
Computer: WEBSERVER01
Description:
A worker process with process id of '3120' serving application pool 'USPool'
has requested a recycle because it reached its private bytes memory limit.

Then about a minute later:

Event Type: Warning
Event Source: W3SVC
Event Category: None
Event ID: 1013
Date: 8/24/2007
Time: 12:44:51 PM
User: N/A
Computer: WEBSERVER01
Description:
A process serving application pool 'USPool' exceeded time limits during shut
down. The process id was '3120'.

.... I take it this would cause sessions to be dropped? If so, that's
definitely puzzle solved as we've had several times where everyone is
dropped at the same time. This application was written by a programmer
who's no longer here, and being somewhat new to the world of ASP.Net I'm
trying to fix the problems as they come up. I'm educating myself on the way
ASP.Net does sessions, and I am finding it's a tricky beast to work with..
Any suggestions on alternatives to using inproc?

Thanks again, and take care --

Alex

bruce barker said:
check the event log (on the iis box) for recycle events. these will happen
if your site uses too much memory (large sessions, memory leaks, etc) or
has hanging threads.

if your app is not written to gracefully handle a lost session, then you
should not use inproc sessions.

-- bruce (sqlwork.com)

Hello,

We have a large asp.net writtin in VB.Net 2003, and for some reason the
sessions have started timing out very quickly, like 5-10 minutes in some
cases. In web.config we have the SessionState timeout set at 720
minutes, but this doesn't seem to help.

What we're seeing is users working in the system just fine, then they'll
get the following error when the application tries to reference the
session:

-[Begin Snippet]-------------------------------------
Server Error in '/' Application.

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.

Source Error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
Sigma.DetailsReport.RetrieveData() in
C:\Inetpub\wwwroot\App\Loan\Details.aspx.vb:107
Sigma.DetailsReport.Page_Load(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\App\Loan\Details.aspx.vb:71
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750

Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
ASP.NET Version:1.1.4322.2300
-[End Snippet]-------------------------------------

When reviewing the code from the trace, it always is something that
references something in the Session, and my assumption is the session has
expired causing a null to be returned.

I'm fairly new to the world of VB, but being a seasoned web coder of
other languages I'm not sure exactly what to try next. I'm working on
adding code to detect the timeout and return something other then a .Net
error, but this still won't help the fact that our sessions are timing
out in a matter of minutes when they shouldn't be.

Thanks in advance for any advise or suggestions on this --

Alex
 
G

George Ter-Saakov

Yea, that is the cause,
Process recycled everything flushed, all sessions gone, Application
initializes fresh new.
Not sure what exactly a problem but looks like memory leak of some kind

George.

Alex said:
Hi Bruce,

Actually I hadn't thought about checking the server event log... I did so
and noticed several errors like this:

Event Type: Information
Event Source: W3SVC
Event Category: None
Event ID: 1117
Date: 8/24/2007
Time: 12:43:20 PM
User: N/A
Computer: WEBSERVER01
Description:
A worker process with process id of '3120' serving application pool
'USPool' has requested a recycle because it reached its private bytes
memory limit.

Then about a minute later:

Event Type: Warning
Event Source: W3SVC
Event Category: None
Event ID: 1013
Date: 8/24/2007
Time: 12:44:51 PM
User: N/A
Computer: WEBSERVER01
Description:
A process serving application pool 'USPool' exceeded time limits during
shut down. The process id was '3120'.

... I take it this would cause sessions to be dropped? If so, that's
definitely puzzle solved as we've had several times where everyone is
dropped at the same time. This application was written by a programmer
who's no longer here, and being somewhat new to the world of ASP.Net I'm
trying to fix the problems as they come up. I'm educating myself on the
way ASP.Net does sessions, and I am finding it's a tricky beast to work
with.. Any suggestions on alternatives to using inproc?

Thanks again, and take care --

Alex

bruce barker said:
check the event log (on the iis box) for recycle events. these will
happen if your site uses too much memory (large sessions, memory leaks,
etc) or has hanging threads.

if your app is not written to gracefully handle a lost session, then you
should not use inproc sessions.

-- bruce (sqlwork.com)

Hello,

We have a large asp.net writtin in VB.Net 2003, and for some reason the
sessions have started timing out very quickly, like 5-10 minutes in some
cases. In web.config we have the SessionState timeout set at 720
minutes, but this doesn't seem to help.

What we're seeing is users working in the system just fine, then they'll
get the following error when the application tries to reference the
session:

-[Begin Snippet]-------------------------------------
Server Error in '/' Application.

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.

Source Error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
Sigma.DetailsReport.RetrieveData() in
C:\Inetpub\wwwroot\App\Loan\Details.aspx.vb:107
Sigma.DetailsReport.Page_Load(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\App\Loan\Details.aspx.vb:71
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750

Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
ASP.NET Version:1.1.4322.2300
-[End Snippet]-------------------------------------

When reviewing the code from the trace, it always is something that
references something in the Session, and my assumption is the session
has expired causing a null to be returned.

I'm fairly new to the world of VB, but being a seasoned web coder of
other languages I'm not sure exactly what to try next. I'm working on
adding code to detect the timeout and return something other then a .Net
error, but this still won't help the fact that our sessions are timing
out in a matter of minutes when they shouldn't be.

Thanks in advance for any advise or suggestions on this --

Alex
 
A

Alex

Thanks... This is definitely what's causing the problem. We just got calls
from users getting kicked out, and after checking the event logs yet another
recycle. Now the research to find what's going on.

Thanks again for the info, once we figure out why the pool is recycling, our
problems should be solved.

Take care -- Alex


George Ter-Saakov said:
Yea, that is the cause,
Process recycled everything flushed, all sessions gone, Application
initializes fresh new.
Not sure what exactly a problem but looks like memory leak of some kind

George.

Alex said:
Hi Bruce,

Actually I hadn't thought about checking the server event log... I did
so and noticed several errors like this:

Event Type: Information
Event Source: W3SVC
Event Category: None
Event ID: 1117
Date: 8/24/2007
Time: 12:43:20 PM
User: N/A
Computer: WEBSERVER01
Description:
A worker process with process id of '3120' serving application pool
'USPool' has requested a recycle because it reached its private bytes
memory limit.

Then about a minute later:

Event Type: Warning
Event Source: W3SVC
Event Category: None
Event ID: 1013
Date: 8/24/2007
Time: 12:44:51 PM
User: N/A
Computer: WEBSERVER01
Description:
A process serving application pool 'USPool' exceeded time limits during
shut down. The process id was '3120'.

... I take it this would cause sessions to be dropped? If so, that's
definitely puzzle solved as we've had several times where everyone is
dropped at the same time. This application was written by a programmer
who's no longer here, and being somewhat new to the world of ASP.Net I'm
trying to fix the problems as they come up. I'm educating myself on the
way ASP.Net does sessions, and I am finding it's a tricky beast to work
with.. Any suggestions on alternatives to using inproc?

Thanks again, and take care --

Alex

bruce barker said:
check the event log (on the iis box) for recycle events. these will
happen if your site uses too much memory (large sessions, memory leaks,
etc) or has hanging threads.

if your app is not written to gracefully handle a lost session, then you
should not use inproc sessions.

-- bruce (sqlwork.com)


Alex wrote:
Hello,

We have a large asp.net writtin in VB.Net 2003, and for some reason the
sessions have started timing out very quickly, like 5-10 minutes in
some cases. In web.config we have the SessionState timeout set at 720
minutes, but this doesn't seem to help.

What we're seeing is users working in the system just fine, then
they'll get the following error when the application tries to reference
the session:

-[Begin Snippet]-------------------------------------
Server Error in '/' Application.

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.

Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
Sigma.DetailsReport.RetrieveData() in
C:\Inetpub\wwwroot\App\Loan\Details.aspx.vb:107
Sigma.DetailsReport.Page_Load(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\App\Loan\Details.aspx.vb:71
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750

Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
ASP.NET Version:1.1.4322.2300
-[End Snippet]-------------------------------------

When reviewing the code from the trace, it always is something that
references something in the Session, and my assumption is the session
has expired causing a null to be returned.

I'm fairly new to the world of VB, but being a seasoned web coder of
other languages I'm not sure exactly what to try next. I'm working on
adding code to detect the timeout and return something other then a
.Net error, but this still won't help the fact that our sessions are
timing out in a matter of minutes when they shouldn't be.

Thanks in advance for any advise or suggestions on this --

Alex
 
J

Juan T. Llibre

Besidess running Scott Guthrie's code to pinpoint the reason
for the recycling of the apps, you should look into using a
different method of maintaining state for your apps.

Maintaining session state with either SQL Server or State Server
will preserve session values across application recycles.






Alex said:
Thanks... This is definitely what's causing the problem. We just got calls from users getting kicked out, and after
checking the event logs yet another recycle. Now the research to find what's going on.

Thanks again for the info, once we figure out why the pool is recycling, our problems should be solved.

Take care -- Alex


George Ter-Saakov said:
Yea, that is the cause,
Process recycled everything flushed, all sessions gone, Application initializes fresh new.
Not sure what exactly a problem but looks like memory leak of some kind

George.

Alex said:
Hi Bruce,

Actually I hadn't thought about checking the server event log... I did so and noticed several errors like this:

Event Type: Information
Event Source: W3SVC
Event Category: None
Event ID: 1117
Date: 8/24/2007
Time: 12:43:20 PM
User: N/A
Computer: WEBSERVER01
Description:
A worker process with process id of '3120' serving application pool 'USPool' has requested a recycle because it
reached its private bytes memory limit.

Then about a minute later:

Event Type: Warning
Event Source: W3SVC
Event Category: None
Event ID: 1013
Date: 8/24/2007
Time: 12:44:51 PM
User: N/A
Computer: WEBSERVER01
Description:
A process serving application pool 'USPool' exceeded time limits during shut down. The process id was '3120'.

... I take it this would cause sessions to be dropped? If so, that's definitely puzzle solved as we've had several
times where everyone is dropped at the same time. This application was written by a programmer who's no longer
here, and being somewhat new to the world of ASP.Net I'm trying to fix the problems as they come up. I'm educating
myself on the way ASP.Net does sessions, and I am finding it's a tricky beast to work with.. Any suggestions on
alternatives to using inproc?

Thanks again, and take care --

Alex

check the event log (on the iis box) for recycle events. these will happen if your site uses too much memory (large
sessions, memory leaks, etc) or has hanging threads.

if your app is not written to gracefully handle a lost session, then you should not use inproc sessions.

-- bruce (sqlwork.com)


Alex wrote:
Hello,

We have a large asp.net writtin in VB.Net 2003, and for some reason the sessions have started timing out very
quickly, like 5-10 minutes in some cases. In web.config we have the SessionState timeout set at 720 minutes, but
this doesn't seem to help.

What we're seeing is users working in the system just fine, then they'll get the following error when the
application tries to reference the session:

-[Begin Snippet]-------------------------------------
Server Error in '/' Application.

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the
stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the
origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Sigma.DetailsReport.RetrieveData() in C:\Inetpub\wwwroot\App\Loan\Details.aspx.vb:107
Sigma.DetailsReport.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\App\Loan\Details.aspx.vb:71
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750

Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
-[End Snippet]-------------------------------------

When reviewing the code from the trace, it always is something that references something in the Session, and my
assumption is the session has expired causing a null to be returned.

I'm fairly new to the world of VB, but being a seasoned web coder of other languages I'm not sure exactly what to
try next. I'm working on adding code to detect the timeout and return something other then a .Net error, but this
still won't help the fact that our sessions are timing out in a matter of minutes when they shouldn't be.

Thanks in advance for any advise or suggestions on this --

Alex
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top