We have seen this question/quandary before and invariably we've found that
the connections were not getting closed while a handle to the connection was
still available. I would scour your code again looking for places where a
DataReader was passed out of a Function but the receiving class did not
close the DataReader (assuming you had CommandBehavior.CloseConnection set).
Okay, let's assume you ARE closing all of the connections. Another
possibility is that the connections are being held open so long that the
incoming ASP requests are overloading the system so new requests have to use
a new connection (instead of inheriting a dormant connection). This is
caused by slow queries, poor indexing, improper query design or a lack of
RAM (among other things) on the server.
As far as monitoring the pool, if you're using SqlClient, you can try to use
the Performance Counters generated by this provider using PerfMon.
No, going to COM+ won't solve anything. It uses the pool too...
hth
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"ra294" <ra***@hotmail.com> wrote in message
news:Ou**************@TK2MSFTNGP10.phx.gbl...
I have an ASP.net application using SQL Server 2000 that every once in a
while I am getting this error:
"System.InvalidOperationException: Timeout expired. The timeout period
elapsed prior to obtaining a connection from the pool. This may have
occurred because all pooled connections were in use and max pool size was
reached"
I looked at my code and It seems that I do close every connection that I
open so I don't know why I am getting this error.
1. What is the best way to find where this problem is coming from ?
2. In order to monitor it, is there a way to print the number of free
connections in the pool (for example every time I open a new one) ?
3. Is there a way to force clearing the pool from old connections ?
Thanks for your time
ra***@hotmail.com