skip to main content
Using the ODBC Client : Configuring Connection Failover
 

Configuring Connection Failover

Connection failover allows an application in a client/server configuration to connect to an alternate, or backup, database server if the primary database server is unavailable, for example, because of a hardware failure or traffic overload. Connection failover ensures that the data on which your critical ODBC applications depend is always available.Connection failover provides protection for new connections only and does not preserve states for transactions or queries.
In a client/server configuration, you can customize the ODBC driver for connection failover by configuring a list of alternate OpenAccess SDK servers that are tried if the primary server is not accepting connections. Connection attempts continue until a connection is successfully established or until all the alternate OpenAccess SDK servers have been tried the specified number of times.
For example, suppose you have the environment shown below with multiple OpenAccess SDK servers: Server A, B, and C. Server A is designated as the primary OpenAccess SDK server, Server B is the first alternate server, and Server C is the second alternate server.
Figure 3: Configuring Connection Failover with the ODBC Client
First, the application attempts to connect to the primary OpenAccess SDK server, Server A (1). If connection failover is enabled and Server A fails to accept the connection, the application attempts to connect to Server B (2). If that connection attempt also fails, the application attempts to connect to Server C (3).
In this scenario, it is probable that at least one connection attempt would succeed, but if no connection attempt succeeds, the ODBC Client can retry each alternate OpenAccess SDK Server (primary and alternate) for a specified number of attempts. You can specify the number of attempts that are made through the connection retry feature. You can also specify the number of seconds of delay, if any, between attempts through the connection delay feature. See Using Connection Retry for more information about connection retry.
The ODBC Client fails over to the next alternate OpenAccess SDK server only if a successful connection cannot be established with the current alternate server. If the ODBC Client successfully establishes communication with an OpenAccess SDK Server and the connection request is rejected by the OpenAccess SDK Server because, for example, the login information is invalid, then the ODBC Client generates an error and does not try to connect to the next OpenAccess SDK Server in the list.
To configure connection failover, you must specify a list of alternate OpenAccess SDK Servers that are tried at connection time if the primary server is not accepting connections. To do this, use the AlternateServers connection option.
Optionally, you can specify the following additional connection failover features:
The number of times the ODBC Client attempts to connect to the primary and alternate OpenAccess SDK servers after the initial unsuccessful connection attempt. By default, the ODBC Client does not retry. To set this feature, use the Connection Retry Count (ConnectionRetryCount) connection option. See Using Connection Retry for more information.
The wait interval, in seconds, between attempts to connect to the primary and alternate OpenAccess SDK servers. The default interval is 3 seconds. To set this feature, use the Connection Retry Delay (ConnectionRetryDelay) connection option.
Whether the ODBC Client will use client load balancing in its attempts to connect to primary and alternate OpenAccess SDK servers. If load balancing is enabled, the ODBC Client uses a random pattern instead of a sequential pattern in its attempts to connect. The default value is not to use load balancing. To set this feature, use the Load Balancing (LoadBalancing) connection option. See Using Client Load Balancing for more information.
Refer to the OpenAccess SDK Administrator’s Guide for detailed, environment-specific information about the following ways to configure connection failover:
On Windows, use the Failover tab of the ODBC Client’s Driver Setup dialog box to configure a data source.
On Linux and UNIX, modify your system information file (odbc.ini) to configure a data source.
On Windows, Linux, and UNIX, use a connection string