Haoest
Haoest

Reputation: 13916

How to get better control over connection pool?

I've been getting this error recently, after several reloads of the same page:

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

So I am thinking there must be some queries or calls in the app I used incorrectly that causes them not to release the connection. Is there any tools out there that allows me to somehow peek into the pool to see who is hanging on to what?

Upvotes: 1

Views: 788

Answers (1)

Mr Shoubs
Mr Shoubs

Reputation: 15419

There's a timeout property on your connection object that you can change. This will change the time it waits to get a connection, there's also a command timeout which controls how long it waits until the command times out once it is running (but the first one sounds like what you need) see here (anything that inherits from DBConnection should have this if you arn't using sql server).

Have a look here too, might help :)

Upvotes: 1

Related Questions