Configuring automatic client reroute for applications that use Db2 databases
You can configure your client applications for a DB2® database to recover from a communication loss with the automatic client reroute (ACR) feature. The applications can continue to work with minimal interruption. The ACR feature is provided by the Db2 server and is not a feature of the application server.
Before you begin
- You have a Db2 data source that is defined in the application server. For more information about creating a data source, see the Configuring a data source by using the administrative console topic.
- The Db2 data
source to which your application connects is running one of the following Db2 versions:
- Db2 for z/OS Version 10.1 or later
- Db2 Database for Linux®, UNIX, and Windows Version 9.7 or later
- You implemented the Db2 database with a redundant setup or the ability to fail the Db2 server to a standby node.
About this task
With the ACR feature for Db2, you can reroute to an alternative database server location if the connection to the primary database server fails. This feature is provided by the Db2 server and IBM Data Server Driver for JDBC and SQLJ (JCC) and is not a feature of the application server. You must enable and configure ACR on the Db2 server. For more information, see the Db2 Automatic client reroute documentation in Related Information.
After you configure ACR on the Db2 server, you must also configure the Db2 data source in the application
server. To support client reroute, you must specify the alternative server name and alternative port
number fields or the clientRerouteAlternateServerName
and
clientRerouteAlternatePortNumber
data source custom properties. The values of these
properties must match the values that are configured in the Db2 server. After ACR is configured, if
the JDBC driver is not able to connect to the primary Db2 server, JCC reroutes the connection to the alternative
server.
enableClientAffinitiesList
,
changes the semantics of the clientRerouteAlternateServerName
and
clientRerouteAlternatePortNumber
properties. To learn more about these properties,
see the Db2 documentation topic, Common IBM Data Server Driver for JDBC and SQLJ properties
for all supported database products. To learn more about client affinity, see the topic,
Configuring client affinity for applications that use Db2 databases.If you configured a Db2 data source as a Type 4 JDBC driver, you can use the Client reroute server list
JNDI name field, or the clientRerouteServerListJNDIName
data source
custom property, to enable persistence of the client reroute state. Typically, when a connection is
rerouted and the JDBC driver has connected to the alternative Db2 server, the alternative server sends
information about its own alternative server to the JDBC driver. The JDBC driver then has the
information that is required to reroute the connection again if the alternative Db2 server is not available.
Effectively, the server that was originally the alternative server is now the primary server, and a
new alternative server has been established. If you enable persistence for client reroute, this new
state can be remembered. If the application server crashes and is restarted, the JDBC driver can
connect to the Db2
server that was considered the primary server at the time of the crash. Without the persistence
feature, the JDBC driver must start from the original server configuration and attempt to connect to
the server that was originally considered the primary server.
Procedure
What to do next
- Select Unbind client reroute list from JNDI.
- Click OK.
- Save the configuration.
- Click Test connection for the data source.
- Clear Unbind client reroute list from JNDI.
- Click OK.
- Save the configuration.