DB2 Version 10.1 for Linux, UNIX, and Windows

Operation of the automatic client reroute feature when connecting to the Informix database server server from an application other than a Java™ application

Automatic client reroute support provides failover support when an IBM® data server client loses connectivity to a server in an Informix® high availability cluster. Automatic client reroute enables the client to recover from a failure by attempting to reconnect to the database through any available server in the cluster.

Automatic client reroute is enabled by default when workload balancing is enabled.

If automatic client reroute is enabled, the following process typically occurs when a client encounters a connection failure with an existing connection:

  1. The client attempts to execute an SQL statement using an existing connection and encounters a failure.
  2. The client uses the server list that is returned by the Connection Manager to identify the server to access, and attempts to reconnect to the database.
  3. If the automatic client reroute process can reconnect the application to the database, the client reconstructs the execution environment for the newly established connection. The error SQL30108N is returned to the application to indicate that the failed database connection has been recovered and that the transaction has been rolled back. The application is then responsible for further recovery, including repeating any work that was rolled back.

    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.

  4. If automatic client reroute is unable to reconnect to the database, the error SQL30081N is returned to the application. The application is then responsible for recovering from the connection failure (for example, by attempting to connect to the database by itself).

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.

If all the data, including the end of file (EOF) character, is returned in the first query block or in a subsequent fetch request, the CLI driver can perform seamless failover when you issue a COMMIT or ROLLBACK statement after the server becomes unreachable. For seamless failover to take place, the following conditions must be met: 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).

If the QueryTimeoutparameter is set in the non-seamless ACR environment, following behaviors are observed:

When the Interrupt parameter is set to the value of 2 and 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.