The following levels of failover protection are supported to ensure continuous, uninterrupted access to data.
Connection failover provides failover protection for new connections only. The driver fails over new connections to an alternate, or backup, database server if the primary database server is unavailable, for example, because of a hardware failure or traffic overload. If a connection to the database is lost, or dropped, the driver does not fail over the connection. This failover method is the default.
Extended connection failover provides failover protection for new connections and lost database connections. If a connection to the database is lost, the driver fails over the connection to an alternate server, preserving the state of the connection at the time it was lost, but not any work in progress.
Select connection failover provides failover protection for new connections and lost database connections. In addition, it provides protection for Select statements that have work in progress. If a connection to the database is lost, the driver fails over the connection to an alternate server, preserving the state of the connection at the time it was lost and preserving the state of any work being performed by Select statements.
The method you choose depends on how failure-tolerant your application is. For example, if a communication failure occurs while processing, can your application handle the recovery of transactions and restart them?
When using either extended connection failover mode or select connection failover mode, your application needs the ability to recover and restart transactions. The advantage of select mode is that it preserves the state of any work that was being performed by the Select statement at the time of connection loss. If your application had been iterating through results at the time of the failure, when the connection is reestablished, the driver can reposition on the same row where it stopped so that the application does not have to undo all of its previous result processing. For example, if your application was paging through a list of items on a Web page when a failover occurred, the next page operation would be seamless instead of starting from the beginning. Performance, however, is a factor in selecting a failover mode. Select mode incurs additional overhead when tracking which rows the application has already processed.
You can specify which failover method you want to use by setting the FailoverMode connection property. Regardless of the failover method you choose, you must configure one or multiple alternate servers using the AlternateServers connection property.