Operation of transaction-level workload balancing for connections to the Db2 for z/OS data sharing group
Transaction-level workload balancing for connections to the Db2 for z/OS database contributes to high availability by balancing work among servers in a Db2 for z/OS data sharing group at the start of a transaction.
When a client connects to a Db2 for z/OS server and transaction-level workload balancing is enabled, the following steps occur:
- When the client first establishes a connection to the Db2 for z/OS data
sharing group that is using the distributed group IP address, the
client returns a server list with the connection details (IP address,
port, and weight) for the members of the Db2 for z/OS data
sharing group.
The server list is cached by the client. The default life span of the cached server list is 30 seconds.
- At the start of a new transaction, the client reads the cached
server list to identify a server that has unused capacity, and looks
in the transport pool for an idle transport that is tied to the under-utilized
server. An idle transport is a transport that has no associated connection
object.
- If an idle transport is available, the client associates the connection object with the transport.
- If, after a user-configurable timeout period (db2.jcc.maxTransportObjectWaitTime for a Java™ client or maxTransportWaitTime for other clients), no idle transport is available in the transport pool and no new transport can be allocated because the transport pool reached its limit, an error is returned to the application.
- When the transaction runs, it accesses the server that is tied to the transport.
- When the transaction ends, the client verifies with the server that transport reuse is still allowed for the connection object.
- If transport reuse is allowed, the server returns a list of SET
statements for special registers that apply to the execution environment
for the connection object.
The client caches these statements, which it replays in order to reconstruct the execution environment when the connection object is associated with a new transport.
- The connection object is then dissociated from the transport, if the client determines that it needs to do so.
- The client copy of the server list is refreshed when a new connection is made, every 30 seconds, or each user-configured interval.
- When transaction-level workload balancing is required for a new transaction, the client uses the previously described process to associate the connection object with a transport.