Confirming a successful failover

If a connection to the secondary Adaptive Server is established, the Adaptive Server OLE DB Provider returns “E_FAIL” for the function return HRESULT.

To confirm a successful failover, examine the dwMinor field in ERRORINFO (returned from IErrorRecords::GetBasicErrorInfo), or the description returned from IErrorInfo::GetDescription. The dwMinor value should be “30130” for a successful HA failover. The description from IErrorInfo::GetDescription should be as follows, where ASEServerName is the server name failed over to:

“Sybase server is not available or has terminated your
connection, you have successfully connected to the next
available HA server ASEServerName. All transactions has
been rolled back.”

NoteSybase recommends that you check the code returned by dwMinor to determine the success of the failover rather than through examination of the error description.

The client must then reapply the failed transaction with the new connection. If failover happens while a transaction is open, only the changes that were committed to the database before failover are retained.