> I have Web Service with a SQL Connection and every time the web service runs it creates a new SQL Connection on the SQL Server.
> How do I get it to use only 1 SQL connection or at least drop old connections?
Yes, I am closing and disposing of the SQL connection, after returning XML to the User. But I'm not disposing the rest of the webserver code, just the SQL Connection.
As soon as I drop the connection to the SQL Server, SQL Server should be logining out the user acccount. Is that a correct statement?
John
"Antoni Massó Mola" wrote:
> Do you close the connection when your .aspx is finished working with it?
>
> > I have Web Service with a SQL Connection and every time the web service
> runs it creates a new SQL Connection on the SQL Server.
> > How do I get it to use only 1 SQL connection or at least drop old
> connections?
Ian Jones - 22 Jun 2004 14:44 GMT
John,
Not necessarily. .NET pools SQL connections and recycles them to improve
performance as far as I understand.
So when you close a connection, it may still stay connected to SQL Server
from the 'pool', ready for the next instance of the sql connection object.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
conconnectionpoolingforsqlservernetdataprovider.asp
Hope this helps
Ian
> Yes, I am closing and disposing of the SQL connection, after returning XML to the User. But I'm not disposing the rest of the webserver code, just the
SQL Connection.
> As soon as I drop the connection to the SQL Server, SQL Server should be logining out the user acccount. Is that a correct statement?
> John
[quoted text clipped - 5 lines]
> > > How do I get it to use only 1 SQL connection or at least drop old
> > connections?