Automatic client reroute provides failover support when an IBM® data server client loses connectivity to the primary server for a DB2® for Linux, UNIX, and Windows database. Automatic client reroute enables the client to recover from a failure by attempting to reconnect to the database through an alternate server.
If automatic client reroute is enabled for a connection to a database, the following process typically occurs when a client encounters a connection failure with an existing connection:
In a non-DB2 pureScale® environment, the server list contains two entries: one for the primary server and one for the alternate server.
In a DB2 pureScale environment, the server list contains an entry for each member of the DB2 pureScale instance. In addition, if an alternate server is defined for the database, the server list also contains an entry for that alternate server. An entry for a member of the DB2 pureScale instance includes capacity information. If connection-level workload balancing is enabled at the client, the client uses that information to connect to the server with the highest unused capacity. The entry for an alternate server has no capacity information. A connection to the alternate server is attempted only if connections to all of the DB2 pureScale members fail.
If the SQL statement that fails is the first SQL statement in the transaction, automatic client reroute with seamless failover is enabled, and the client is CLI or .NET, the driver replays the failed SQL operation as part of automatic client reroute processing. If the connection is successful, no error is reported to the application, and the transaction is not rolled back. The connectivity failure and subsequent recovery are hidden from the application.
Automatic client reroute is also used when a client encounters a connection failure with a new connection. In this case, however, if reconnection is successful, no error is returned to the application to indicate that the failed database connection has been recovered. If reconnection fails, the error SQL30081N is returned.
You can configure the FetchBufferSize keyword to ensure that the size of the result set that the CLI driver prefetches is sufficient to include the EOF character in the first query block. See the Related reference section for further details on FetchBufferSize.
In the non-seamless ACR environment, the ReceiveTimeout event triggers the ACR connection error (SQL30108N).
When the Interrupt parameter is set to the value of 2 and the SQLCancel() API is explicitly sent from the application while SQL statement is being executed, the ACR connection error (SQL30108N failure code 4 and error code 2) is returned to the application.
If the tcpipConnectTimeout parameter and the memberConnectTimeout parameter is set and the TCPIP Connection timeout or the member connection timeout event occurs in the non-seamless ACR environment, the CLI driver reconnects to a new available member but the ACR error (SQL30108N) is not returned to the application.