Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Unable to connect to SQL Server session database (http://www.velocityreviews.com/forums/t104815-unable-to-connect-to-sql-server-session-database.html)

jamezw 06-16-2005 07:45 PM

Unable to connect to SQL Server session database
 
Hello

I work on a website where we have 3 servers running one site so we use
the SQLServer option for state management. We are using the persistent
ASPState database. All 3 of our webservers are Win2K3 and up-to-date.
Our SQL Server is up-to-date as well. We have been getting weird
site-hanging issues lately which seem to be related to the state
management. Whenever the site starts hanging we will receive an
application error with a stacktrace like such:

System.Web.HttpException: Unable to connect to SQL Server session
database. ---> System.Data.SqlClient.SqlException: Timeout expired.
The timeout period elapsed prior to completion of the operation or the
server is not responding.
at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at
System.Web.SessionState.SqlStateClientManager.Rele aseExclusiveAsyncWorker(String
id, Int32 lockCookie)
--- End of inner exception stack trace ---
at
System.Web.SessionState.SqlStateClientManager.Rele aseExclusiveAsyncWorker(String
id, Int32 lockCookie)
at
System.Web.SessionState.SqlStateClientManager.Syst em.Web.SessionState.IStateClientManager.ReleaseExc lusive(String
id, Int32 lockCookie)
at System.Web.SessionState.SessionStateModule.OnRelea seState(Object
source, EventArgs eventArgs)
at System.Web.SessionState.SessionStateModule.OnEndRe quest(Object
source, EventArgs eventArgs)
at
System.Web.SyncEventExecutionStep.System.Web.HttpA pplication+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously)

When these errors occur, they occur on all three webservers at the same
time, and the same error will re-occur almost exactly 10 minutes later.
We don't have any jobs running on the SQL server or the web servers
that occur every 10 minutes, so we have ruled that out. To fix this
problem, usually we recycle the aspnet processes, but sometimes this
does not work and we have to stop/start SQL Server. In the worst case
scenario, we end up rebooting our SQL Server to "fix" the problem. This
is a really problematic issue for us because it seems to happen during
high traffic times. Has anyone else experienced something similar to
this or know of an MS fix?

Thanks,
James


=?Utf-8?B?Y3Vpa2U1MTk=?= 06-17-2005 02:03 AM

RE: Unable to connect to SQL Server session database
 
Did you set your SqlCommand timeout? That defaults to 30 seconds.
Please try to set CommandTimeout to 180 or longer time:
YourCommand.CommandTimeout = 180

"jamezw" wrote:

> Hello
>
> I work on a website where we have 3 servers running one site so we use
> the SQLServer option for state management. We are using the persistent
> ASPState database. All 3 of our webservers are Win2K3 and up-to-date.
> Our SQL Server is up-to-date as well. We have been getting weird
> site-hanging issues lately which seem to be related to the state
> management. Whenever the site starts hanging we will receive an
> application error with a stacktrace like such:
>
> System.Web.HttpException: Unable to connect to SQL Server session
> database. ---> System.Data.SqlClient.SqlException: Timeout expired.
> The timeout period elapsed prior to completion of the operation or the
> server is not responding.
> at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
> cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
> at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
> at
> System.Web.SessionState.SqlStateClientManager.Rele aseExclusiveAsyncWorker(String
> id, Int32 lockCookie)
> --- End of inner exception stack trace ---
> at
> System.Web.SessionState.SqlStateClientManager.Rele aseExclusiveAsyncWorker(String
> id, Int32 lockCookie)
> at
> System.Web.SessionState.SqlStateClientManager.Syst em.Web.SessionState.IStateClientManager.ReleaseExc lusive(String
> id, Int32 lockCookie)
> at System.Web.SessionState.SessionStateModule.OnRelea seState(Object
> source, EventArgs eventArgs)
> at System.Web.SessionState.SessionStateModule.OnEndRe quest(Object
> source, EventArgs eventArgs)
> at
> System.Web.SyncEventExecutionStep.System.Web.HttpA pplication+IExecutionStep.Execute()
> at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
> Boolean& completedSynchronously)
>
> When these errors occur, they occur on all three webservers at the same
> time, and the same error will re-occur almost exactly 10 minutes later.
> We don't have any jobs running on the SQL server or the web servers
> that occur every 10 minutes, so we have ruled that out. To fix this
> problem, usually we recycle the aspnet processes, but sometimes this
> does not work and we have to stop/start SQL Server. In the worst case
> scenario, we end up rebooting our SQL Server to "fix" the problem. This
> is a really problematic issue for us because it seems to happen during
> high traffic times. Has anyone else experienced something similar to
> this or know of an MS fix?
>
> Thanks,
> James
>
>


jamezw 06-17-2005 12:44 PM

Re: Unable to connect to SQL Server session database
 
It's not as simple as that. The problem is with .NET's session
management through SQL server.



All times are GMT. The time now is 02:05 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.