Hi, we have a C# web application with SQL Server 2005 as backend database. we have not disabled connection pooling in the connection string, so by default the connection pooling should be working. we are properly opening and closing the connections. But we have noticed large number of sleeping processes(Awaiting Command) with the oldest connection sleeping is some 5 months back. Is there any configuration setting in SQL 2005 for auto-close of sleeping processes or disallow the process in sleeping state for long duration? We are getting the following for connections to the server now : SQL connection get returned error. Message:An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - Only one usage of each socket address (protocol/network address/port) is normally permitted.) SQLState :[0] ErrorCode : [10048] Is this due to the sleeping connections?
Hello, Yes but ultimately is due to what you are doing in your code and that's also where you have to solve the problem - not in the SQL Server. This post explains what is going on and how to resolve it: http://social.msdn.microsoft.com/Fo...s/thread/00720c5c-36a5-40a2-8aed-6be1ce7ae752 HTH /Elisabeth
hello, i think so elzibeth tell you the right path and the pasted link described the problem very well and solution
Naveen, Welcome to the forums. I believe it is the recordset which has these connections leaving at the server, I would guess that the application is performing multiple connection to the database that you configure to use one connection multiple times. By default SQL server will not terminate the connection unless it is initated from the application or you KILL the processes. Such as causing these completed processed connections rather we can class them as orphaned, but still using the memory causing the default error. I would also refer to look for any blocking/locking at the time when you see this error as it may be because of a locking query, which is holding one table and others are waiting. A normal select/update/delete/Insert statement is escalated to a locking one if it is taking more time. A select be default is a locking one. The trick is to avoid such long running queries. You should focus on that. OR In your program itself you can set the time out value (query time out).
How are you closing your connections? Do you have all SqlConnection objects wrapped in using statements or try/finally blocks? Are you calling Dispose() or just Close()?