.Net ADO.Net SqlClient.SqlConnection connection pool clear
Posted on 2007-07-25
I have a .net winform app where the sqlclient.sqlconnection objects are not being disposed.
Hence I have a bunch of open connections, which after some time cause the application to get the "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." error
What I want to do, is in my error handler, when I get this message, force the connection pool to be cleared. All open connections for the application be closed, and then continue.
Any ideas on how to do it ?