host2a:port2a is stored as the new alternative server. If another communication
failure is detected on this same connection, or on another connection that is
created from the same DataSource, the driver tries to connect to host1a:port1a
as the new primary server. If that connection fails, the driver tries to connect to
the new alternate server host2a:port2a.
5. The driver connects to host1a:port1a.
6. A failure occurs during the connection to host1a:port1a.
7. The driver tries to connect to host2a:port2a.
8. The connection to host2a:port2a is successful.
9. The driver retrieves alternate server information that was received from server
host2a:port2a, and updates its memory with that information.
Example: Client reroute to a DB2 server when maxRetriesForClientReroute and
retryIntervalForClientReroute are set for multiple retries: Suppose that the following
properties are set for a connection to a database:
Property Value
enableClientAffinitiesList DB2BaseDataSource.NO (2)
serverName host1
portNumber port1
clientRerouteAlternateServerName host2
clientRerouteAlternatePortNumber port2
maxRetriesForClientReroute 3
retryIntervalForClientReroute 2
The following steps demonstrate a client reroute scenario for a connection to a DB2
for z/OS or DB2 Database for Linux, UNIX, and Windows server:
1. The IBM Data Server Driver for JDBC and SQLJ loads host1:port1 into its
memory as the primary server address, and host2:port2 into its memory as the
alternate server address.
2. On the initial connection, the driver tries to connect to host1:port1.
3. The connection to host1:port1 fails, so the driver tries another connection to
host1:port1.
4. The connection to host1:port1 fails again, so the driver tries to connect to
host2:port2.
5. The connection to host2:port2 fails.
6. The driver waits two seconds.
7. The driver tries to connect to host1:port1 and fails.
8. The driver tries to connect to host2:port2 and fails.
9. The driver waits two seconds.
10. The driver tries to connect to host1:port1 and fails.
11. The driver tries to connect to host2:port2 and fails.
12. The driver waits two seconds.
13. The driver throws an SQLException with error code -4499.
The following steps demonstrate a client reroute scenario for a connection to IBM
Informix Dynamic Server:
94 Application Programming Guide and Reference for Java
â„¢
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
||
||
||
||
||
||
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|