> # Configuring Connection Failover

> Connection failover allows an application to connect to an alternate, or backup, SequeLink 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.

> You can customize the ODBC Client for connection failover by configuring a list of alternate SequeLink 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 SequeLink servers have been tried the specified number of times.

> For example, suppose you have the environment shown in Figure 1-1 with multiple SequeLink servers: SequeLink Server A, B, and C. SequeLink Server A is designated as the primary database server, SequeLink Server B is the first alternate server, and SequeLink Server C is the second alternate server.

> Figure 1-1. Configuring Connection Failover with the ODBC Client

> First, the application attempts to connect to the primary database server, SequeLink Server A (1). If connection failover is enabled and SequeLink Server A fails to accept the connection, the application attempts to connect to SequeLink Server B (2). If that connection attempt also fails, the application attempts to connect to SequeLink Server C (3).

> In this scenario, it is probable that at least one connection attempt would succeed, but if no connection attempt succeeds, the driver can retry each alternate SequeLink 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 SequeLink server only if a successful connection cannot be established with the current alternate server. If the ODBC Client successfully establishes communication with a SequeLink Server and the connection request is rejected by the SequeLink Server because, for example, the login information is invalid, then the driver generates an error and does not try to connect to the next SequeLink Server in the list.

> Connection failover provides protection for new connections only and does not preserve states for transactions or queries. For details on configuring connection failover, refer to the SequeLink Administrator's Guide.

> To configure connection failover, you must specify a list of alternate SequeLink 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 SequeLink 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 SequeLink servers. The default interval is 3 seconds. To set this feature, use the Connection Retry Delay (ConnectionRetryDelay) connection option.
> - Whether the ODBC Client uses client load balancing in its attempts to connect to primary and alternate SequeLink 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.

> On Windows, you can configure a data source to use connection failover on the Failover tab of the driver's Setup dialog box. Refer to the SequeLink Administrator's Guide for detailed information.

> On UNIX and Linux, you can configure a data source to use connection failover by modifying your system information file (odbc.ini). Refer to the SequeLink Administrator's Guide for detailed information.

> On Linux, UNIX, and Windows, you can use a connection string to direct the driver to use connection failover. Refer to the SequeLink Administrator's Guide for detailed information.

> ### Connection Failover Properties

> Table 1-2 summarizes the connection properties that control how connection failover works with the ODBC driver. See Table 1-1 "ODBC Connection Attributes" for details about configuring each property.

> Table 1-2. Summary: Connection Failover Attributes for the ODBC Driver
> Connection Attribute | Characteristic
> --- | ---
> AlternateServers | A list of alternate SequeLink servers to which the driver will attempt to connect if the primary SequeLink server is unavailable. A port number and an IP address or server name identifying each server are required. If the primary SequeLink server is an LDAP server, each alternate server must be an LDAP server.
> ConnectionRetryCount | Number of times the driver retries the primary SequeLink server, and if specified, alternate servers until a successful connection is established. The default is 5.
> ConnectionRetryDelay | Wait interval, in seconds, between connection retry attempts when the ConnectionRetryCount property is set to a positive integer. The default is 1.
> Host | The TCP/IP address or server name of primary SequeLink server. LDAP: If LDAP is enabled, this identifies the TCP/IP address of the LDAP server. This can also be a list of LDAP servers separated by a blank space (for example, "ld1.foo.com ld2.foo.com ld3.foo.com"). If the first LDAP server in the list does not respond, the ODBC Client will try to connect to the next LDAP server in the list.
> LoadBalancing | Sets whether the driver will use client load balancing in its attempts to connect to the list of SequeLink servers (primary and alternate). If client load balancing is enabled, the driver uses a random pattern instead of a sequential pattern in its attempts to connect. The default is false (client load balancing is disabled).
> Port | The TCP/IP port on which the primary SequeLink server is listening. If LDAP is enabled, this identifies the TCP/IP port on which the LDAP server is listening.