Connection Pool problems causing Timeouts

I really didn't expect to be debugging site issues this morning, and funny that all of a sudden this would appear:

Exception Details: 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.

The DiscountASP.net support folks were very helpful to explain I apparently was not closing every connection string, and the site was busy past what garbage cleanup could keep up with... hmm... that sounds like a 'woo hoo' to me :) ... too busy to keep up... oh but wait... my site was down.. dang!

So.. I first went in and added "Max Pool Size=100" to my connection string and refreshed the site to get things rolling again, then went and searched for all my open connections. I call a support method to get the string, so it was easy to find them all. For the most part it was open... do something... close, but then things changed and I could see I was experimenting a bit with try/catch, and I'm not convinced those were setup correctly, so made some changes, some that later on "hey... these are already the way I'm changing the rest to!"...

Then when I thought things were ok, I had a couple things explode on me because my support code was returning a datareader and the connection string was closed on that baby before it got to be used... hmm... ok, open a SqlConnection, and pass it to the method, then close it when you're done... had to do that a couple times, and hopefully, that foolishness is behind me!

I hate it when the site is down... who knows, both people that go there might be trying at that point!

 

posted @ Saturday, April 07, 2007 12:53 PM

Print

Comments on this entry:

No comments posted yet.

Your comment:



 (will not be displayed)


 
 
 
Please add 2 and 5 and type the answer here:
 

Live Comment Preview:

 
«October»
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678