Connection fault tolerance?

  • Thread starter Thread starter Paschalis Pagonidis
  • Start date Start date
P

Paschalis Pagonidis

Hi all,

I'm trying to make an application tolerant to connection
faults. The concept is when the connection breaks while
running, the application warns user and a timer tries
periodically to recover the connection.

My questions are the following:
1. ADO.Net doesn't trigger the Connection.StateChanged
event until an sql command is being executed (and of
cource fails).
2. When I try to Open() the connection again,
Connection.State equals to ConnectionState.Open even if
NIC is disabled or unplugged!

Any recommendations?

thanks,
Pascal
 
That's what I did.

I've handled this by executing "SELECT 0" in a try/catch
to be sure about it's state.

thanks,
Pascal
 
It sounds like you would want to turn pooling off and manage the connection
yourself for this type of application. Set Pooling=false for SqlClient.

--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging about ADO.NET: http://weblogs.asp.net/angelsb/
 
Back
Top