Max Connection Pool Reached ...

V

Vikram

Hi ,

" 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 am getting this error in my application. All requests to the Database go
through the Data Access layer.
And I am opening and Closing connections in the Data Access Layer. I cant
seem to find out why this is still happening ?

The Server Classes that I have are a mix of ServicedComponents and
non-ServicedComponents and the Data Access Layer
as such is marked as TransactionOption.Supported. How would COM+ affect
pooling ?

Any tips/pointers on how for further diagnosis would be helpful.

Regards ,
Vikram
 
B

bruce barker

adding COM+ support does not change the pooling. either you are getting too
many concurrent hits (maxing the pool) or your dal code is leaking
connections. the second is the more likely case.

some simple rules to prevent leaks

1) all connection opens (or queries) should be in a try/catch block, with
the finally closing the connection.
2) never return a open connection or datareader ( you can not trust the
caller to close it)

-- bruce (sqlwork.com)
 
V

Vikram

Thanks for the response...

I did notice that in a few places a new Connection has been created but the
open has not been called.
Will a SqlConnection object on which a new was done but an Open was not
called be considered a leak ??

Also, should I set ConnectionLifetime to some value ??

Regards,
Vikram
 
S

Scott Allen

That would not cause a leak. Having an Open with no Close would cause
a problem, however.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top