Java client direct connect support for high availability for connections to DB2 for z/OS servers

Sysplex workload balancing functionality on DB2® for z/OS® servers provides high availability for client applications that connect directly to a data sharing group. Sysplex workload balancing functionality provides workload balancing and automatic client reroute capability. This support is available for applications that use Java clients (JDBC, SQLJ, or pureQuery®) that use IBM® Data Server Driver for JDBC and SQLJ type 4 connectivity, or non-Java clients (ODBC, CLI, .NET, OLE DB, PHP, Ruby, or embedded SQL). Workload balancing is transparent to applications.

A Sysplex is a set of z/OS systems that communicate and cooperate with each other through certain multisystem hardware components and software services to process customer workloads. DB2 for z/OS subsystems on the z/OS systems in a Sysplex can be configured to form a data sharing group. With data sharing, applications that run on more than one DB2 for z/OS subsystem can read from and write to the same set of data concurrently. One or more coupling facilities provide high-speed caching and lock processing for the data sharing group. The Sysplex, together with the Workload Manager (WLM), dynamic virtual IP address (DVIPA), and the Sysplex Distributor, allow a client to access a DB2 for z/OS database over TCP/IP with network resilience, and distribute transactions for an application in a balanced manner across members within the data sharing group.

Central to these capabilities is a server list that the data sharing group returns on connection boundaries and optionally on transaction boundaries. This list contains the IP address and WLM weight for each data sharing group member. With this information, a client can distribute transactions in a balanced manner, or identify the member to use when there is a communication failure.

The server list is returned on the first successful connection to the DB2 for z/OS data server. After the client has received the server list, the client directly accesses a data sharing group member based on information in the server list.

DB2 for z/OS provides several methods for clients to access a data sharing group. The access method that is set up for communication with the data sharing group determines whether Sysplex workload balancing is possible. The following table lists the access methods and indicates whether Sysplex workload balancing is possible.

Table 1. Data sharing access methods and Sysplex workload balancing
Data sharing access method1 Description Sysplex workload balancing possible?
Group access A requester uses the DB2 group IP address to make an initial connection to the DB2 for z/OS location. A connection to the data sharing group that uses the group IP address and SQL port is always successful if at least one member is started. The server list that is returned by the data sharing group contains:
  • A list of members that are currently active and can perform work
  • The WLM weight for each member
The group IP address is configured using the z/OS Sysplex distributor. To clients that are outside the Sysplex, the Sysplex distributor provides a single IP address that represents a DB2 location. In addition to providing fault tolerance, the Sysplex distributor can be configured to provide connection load balancing.
Yes
Member-specific access A requester uses a location alias to make an initial connection to one of the members that is represented by the alias. A connection to the data sharing group that uses the group IP address and alias SQL port is always successful if at least one member is started. The server list that is returned by the data sharing group contains:
  • A list of members that are currently active, can perform work, and have been configured as an alias
  • The WLM weight for each member
The requester uses this information to connect to the member or members with the most capacity that are also associated with the location alias. Member-specific access is used when requesters need to take advantage of Sysplex workload balancing among a subset of members of a data sharing group.
Yes
Single-member access Single-member access is used when requesters need to access only one member of a data sharing group. For single-member access, the connection uses the member-specific IP address. No
Note:
  1. For more information on data sharing access methods, see TCP/IP access methods.

Sysplex workload balancing includes automatic client reroute: Automatic client reroute support enables a client to recover from a failure by attempting to reconnect to the data server through any available member of a Sysplex. Reconnection to another member is called failover. Automatic client reroute can be seamless when the application is rerouted, and the application does not receive an error after a network failure to a data sharing member. An example of a situation in which automatic reroute can be seamless is when a member is shut down for maintenance.

Sysplex workload balancing during migration of a data sharing group to DB2 for z/OS V10: In general, if you use IBM Data Server Driver for JDBC and SQLJ Version 3.61 or 4.11, migration of a data sharing group from DB2 for z/OS Version 9.1 to Version 10 does not cause an outage for Java applications that connect to the data sharing group using IBM Data Server Driver for JDBC and SQLJ type 4 connectivity. You do not need to restart all members of the data sharing group or JVMs to maintain balanced connections. In addition, if you use IBM Data Server Driver for JDBC and SQLJ Version 3.62 or 4.12 or later, in any mode during the migration from DB2 for z/OS Version 9.1 new-function mode to Version 10 new-function mode, new applications that use features that require a higher DRDA level can coexist with old applications that use a lower DRDA level, if they use the same DataSource. This coexistence includes reversion from a mode to a previous mode, such as reversion from Version 10 ENFM9 to CM9*. For coexistence of DRDA levels, you need to have APAR PM24292 installed on the DB2 for z/OS Version 9.1 and DB2 for z/OS Version 10 data servers.

For Java, CLI, or .NET client applications, failover for automatic client reroute can be seamless or non-seamless. Seamless failover means that when the application successfully reconnects to an alternate server, the server does not return an error to the application.

Client direct connect support for high availability with a Db2 Connect server: Client direct connect support for high availability requires a Db2 Connect license, but does not need a Db2 Connect server. The client connects directly to DB2 for z/OS.

If you use a Db2 Connect server, but set up your environment for client high availability, you cannot take advantage of some of the features that a direct connection to DB2 for z/OS provides, such as transaction-level workload balancing or automatic client reroute capability that is provided by the Sysplex.

Do not use client affinities: Client affinities should not be used as a high availability solution for direct connections to DB2 for z/OS. Client affinities is not applicable to a DB2 for z/OS data sharing environment, because all members of a data sharing group can access data concurrently. A major disadvantage of client affinities in a data sharing environment is that if failover occurs because a data sharing group member fails, the member that fails might have retained locks that can severely affect transactions on the member to which failover occurs.