I am trying to write a Windows Service which does the
following whenever the SQLServer it is connected to
suddenly goes down:
It periodically checks to see if it can connect to the
database, if it succeeds the application then carries on
as normal.
The problem is, my application makes use of connection
pooling, and when it tries to reconnect to the SQLServer
it seems to refer to a disconnected connection in the
connection pool and raises and general network error even
through the server is definitely running. Now I've
noticed that if I set "Pooling=False" in the connection
string, then this solves the problem but its not practical
for me to disable pooling for the entire application.
Does anyone have any ideas? Is there a way to flush the
entire connection pool?
|