Unable to connect to SQL Server session database

J

jamezw

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(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at
System.Web.SessionState.SqlStateClientManager.ReleaseExclusiveAsyncWorker(String
id, Int32 lockCookie)
--- End of inner exception stack trace ---
at
System.Web.SessionState.SqlStateClientManager.ReleaseExclusiveAsyncWorker(String
id, Int32 lockCookie)
at
System.Web.SessionState.SqlStateClientManager.System.Web.SessionState.IStateClientManager.ReleaseExclusive(String
id, Int32 lockCookie)
at System.Web.SessionState.SessionStateModule.OnReleaseState(Object
source, EventArgs eventArgs)
at System.Web.SessionState.SessionStateModule.OnEndRequest(Object
source, EventArgs eventArgs)
at
System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep 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
 
G

Guest

Did you set your SqlCommand timeout? That defaults to 30 seconds.
Please try to set CommandTimeout to 180 or longer time:
YourCommand.CommandTimeout = 180
 
J

jamezw

It's not as simple as that. The problem is with .NET's session
management through SQL server.
 

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,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top