DataAccess Block issue

  • Thread starter Thread starter Craig Buchanan
  • Start date Start date
C

Craig Buchanan

I'm using the SQLHelper class from Microsoft's DataAccess block in my code.
Recently, I've been getting an error when I try to use the class'
ExecuteReader method. The error reads:

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.

Obviously the connection is not being Dispose(d), but why is this occuring
now? Were is the max pool size setting being set? Should I be calling the
dispose method manually?

Thanks,

Craig Buchanan
 
Craig Buchanan said:
I'm using the SQLHelper class from Microsoft's DataAccess block in my code.
Recently, I've been getting an error when I try to use the class'
ExecuteReader method. The error reads:

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.

Obviously the connection is not being Dispose(d), but why is this occuring
now?

Because the garbage collector will eventually close the connection, so you
won't see this problem until you get some load.
Were is the max pool size setting being set?
In the connection string, default of 100 I think.
Should I be calling the dispose method manually?

That is an absolute requirement.

David
 
David-

I just did a test. I was able to get the timeout error after 8 calls to the
database. In another .net project, I wasn't able to get the error to occur.

Same machine. Same version of .Net (1.1). Same SQL Server 2000 (local).
The connection strings look identical (except for initial catalog).
Connection strings don't specify pool size.

It doesn't make any sense.

Thoughts?

Craig
 
Craig Buchanan said:
David-

I just did a test. I was able to get the timeout error after 8 calls to the
database. In another .net project, I wasn't able to get the error to occur.

Same machine. Same version of .Net (1.1). Same SQL Server 2000 (local).
The connection strings look identical (except for initial catalog).
Connection strings don't specify pool size.

It doesn't make any sense.

Thoughts?

You can walk on thin ice a dozen times without falling in. You wouldn't ask
why you fell in the 13th time. The answer is the weather, or currents or a
small defect in the ice, or whatever.

It all depends on the memory size and the frequency of garbage collections
and other factors. Just Dispose of your connections properly.

David
 
Back
Top