skip to main content
Using the driver : Using failover : Configuring failover
  

Try DataDirect Drivers Now

Configuring failover

Take the following steps to configure failover.
1. Specify the primary and alternate servers:
*Specify your primary server using a connection URL or data source.
*Specify one or multiple alternate servers by setting the AlternateServers property.
See Specifying primary and alternate servers.
Note: To turn off failover, do not specify a value for the AlternateServers property.
Note: If using failover with Microsoft Cluster Server (MSCS), which determines the alternate server for failover instead of the driver, any alternate server specified must be the same as the primary server. For example:
jdbc:datadirect:sqlserver://server1:1433;
DatabaseName=TEST;User=test;Password=secret;
AlternateServers=(server1:1433;DatabaseName=TEST)
2. Choose a failover method by setting the FailoverMode connection property. The default method is connection failover (FailoverMode=connect).
3. If FailoverMode=extended or FailoverMode=select, set the FailoverGranularity property to specify how you want the driver to behave if exceptions occur while trying to reestablish a lost connection. The default behavior of the driver is to continue with the failover process and post any exceptions on the statement on which they occur (FailoverGranularity=nonAtomic).
4. Optionally, configure the connection retry feature. See Specifying connection retry.
5. Optionally, set the FailoverPreconnect property if you want the driver to establish a connection with the primary and an alternate server at the same time. The default behavior is to connect to an alternate server only when failover is caused by an unsuccessful connection attempt or a lost connection (FailoverPreconnect=false).
* Specifying primary and alternate servers
* Specifying connection retry