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.
| 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:
|
Yes |
| Group subset 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 successful if at least one member is started, and that member has its TCP/IP listener ready and has the capacity to accept new connections on the alias SQL port. The server list that is returned by the data sharing group contains:
|
Yes |
| Member-specific access | Member-specific access is used when requesters need to access only one member of a data sharing group. For member-specific access, the connection uses the member-specific IP address. For member-specific access to be used, IBM Data Server Driver for JDBC and SQLJ properties enableSysplexWLB and enableConnectionConcentrator must be set to false. | No |
|
Note:
|
||
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.
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.
With seamless failover, the IBM Data Server Driver for JDBC and SQLJ sets the application environment from the old server on the new server. This environment includes special register values and global variable values.
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.
Restriction on sysplex workload balancing and automatic client reroute: When a Java application that is connected to a Db2 for z/OS data server references or sets a global variable that is a user-defined array type or a LOB, the data server disables transaction balancing across the data sharing group. The data server prevents automatic client reroute after a member fails or is forced to shut down. The thread remains active until the application disconnects from the data server.