Failover fails when network cable unplugged.
Posted: Tue 13 Apr 2010 06:46
Hi
I'm currently running SQL 2005 Mirroring setup. Using a simple app that just connect to the current principal database of the mirroring pair.
MSConnection is setup with the connection string pointing to the principal server.
On the TMSConnection object the Failoverpartner and localfailover values is specified. All that the app does is it loads all the record from a single table in the database to a grid, using a query component and the msconnection.
Using SDAC 4 with Delphi 5.
App is running on PC1 that link to the principal DB on PC2 with the mirror on PC3.
When using the failover option in SQL to force failover of the databses, the msconnection work 100%. the OnLostConnection event is raised and the connection is reconnected to the failOver server. If the failover is done back again everything still works. No problems there.
The problem occurs when the network cable is unplugged. The failover takes a couple of second longer(10seconds), where if the failover function in sql is used, the failover takes 1 or 2 seconds.
If I refresh the grid data as soon as I unplug the cable, there is a delay, connection time out period, and then I get the error 'TCP Provider: The semaphore timeout period has expired'. If I try the refresh the dataset again the I get the error 'Communication link failure. From then on it stays with the communication error. Not once did the OnLostconnection event fired to try and reconnect to the failOver server.
It seems that msconnection detects the network error, to the principal server, first and stops at that point and does not try to connect to the failover server. I can add code in the onerror event of msconnection to close and reconnect the connection, but is there a way to force msconnection to try a reconnect to the failover server when the communication link error occurs. The network link to the failover server is still up and running, it is only the principal server network link that died.
Regards
Magnus
I'm currently running SQL 2005 Mirroring setup. Using a simple app that just connect to the current principal database of the mirroring pair.
MSConnection is setup with the connection string pointing to the principal server.
On the TMSConnection object the Failoverpartner and localfailover values is specified. All that the app does is it loads all the record from a single table in the database to a grid, using a query component and the msconnection.
Using SDAC 4 with Delphi 5.
App is running on PC1 that link to the principal DB on PC2 with the mirror on PC3.
When using the failover option in SQL to force failover of the databses, the msconnection work 100%. the OnLostConnection event is raised and the connection is reconnected to the failOver server. If the failover is done back again everything still works. No problems there.
The problem occurs when the network cable is unplugged. The failover takes a couple of second longer(10seconds), where if the failover function in sql is used, the failover takes 1 or 2 seconds.
If I refresh the grid data as soon as I unplug the cable, there is a delay, connection time out period, and then I get the error 'TCP Provider: The semaphore timeout period has expired'. If I try the refresh the dataset again the I get the error 'Communication link failure. From then on it stays with the communication error. Not once did the OnLostconnection event fired to try and reconnect to the failOver server.
It seems that msconnection detects the network error, to the principal server, first and stops at that point and does not try to connect to the failover server. I can add code in the onerror event of msconnection to close and reconnect the connection, but is there a way to force msconnection to try a reconnect to the failover server when the communication link error occurs. The network link to the failover server is still up and running, it is only the principal server network link that died.
Regards
Magnus