473,398 Members | 2,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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

Nov 19 '05 #1
2 9602
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

Nov 19 '05 #2
It's not as simple as that. The problem is with .NET's session
management through SQL server.

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Brian Pittman | last post by:
Hi all, As the subject says I'm having trouble connecting to SQL Server 2K via Visual Studio.NET 2002 (VB). It tells me that SQL Server does not exist or access is denied. I know that the...
3
by: Gary K | last post by:
After a bit a trouble getting VS to create a project on a different web server (I forgot to apply the 'fix'), I get the following error when trying to debug my web application. Error while...
4
by: Abi | last post by:
We able to generate this error in our test environment and were able to research this enough to understand that the issue is NOT with an abject that needs to be serialized but rather as the stack...
0
by: Nachi | last post by:
I have installed SQL Server 2000 with VS 2005 - did not install SqlExpress\Sql 2005. I have a remote Sql Server Instance locally. The normal application connectes to this Sql Server. When I run...
1
by: GNoter | last post by:
Scenario: I've a WebFarm with 2 web servers which are NLBs (network load balanced). Web1 and Web2; they are not part of a domain. I have a third server, Server3, which is part of a domain and on...
3
by: LamSoft | last post by:
I am not going to write a aspx to connect a SQL Server... but it tries to connect the SQL Server... Some of the Code.. protected void LoginButton_Click(object sender, EventArgs e) { if...
0
by: =?Utf-8?B?QmFsYWpp?= | last post by:
The issue description is as follows: Environment Windows Server 2003 SP2 Framework 1.1 Framework 2.0 SqlServer 2000 Description: The Web server hosts both Framework 1.1 and 2.0 applications....
21
by: Steve | last post by:
I moved my database from one server to another SQL server. I did a backup and restore of the database. I can connect to the database on server A from my asp.net app but when I try to connect to my...
6
Cintury
by: Cintury | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.