Every time my asp.net app needs to open a connection, it tries to establish a new connection with the mssql server. I′ve already set the max pool size property in the connection string. After that, my app raises an "time out"error saying it couldn′t obtain a connection from the pool. The problem is that I have a lot of iddle connections. With the Enterprise Manager I can see the status of the connections. They′re all the same "awaiting command". How can I reuse this connections? I know that the connection string must be the same for all connections and it is. I′ve set it in the web.config file. If I remove the max pool size property from the connection string I get a lot, I mean A LOT of connections with the sql server. Any ideas?
You should be ensuring that all connections get closed using a try/catch/finally block. Also, take a look at the following articles:
Tuning Up ADO.NET Connection Pooling With ASP.NET Applications
ASP.NET and SQL Server Performance Tips
The .NET Connection Pool Lifeguard
HTH
No comments:
Post a Comment