Configuration of Db2 on Linux, UNIX, and Windows systems workload balancing support for Java clients
To configure a IBM® Data Server Driver for JDBC and SQLJ client application that connects to a Db2 on Linux, UNIX, and Windows systems Db2 pureScale® instance for workload balancing, you need to connect to a member of the Db2 pureScale instance, and set the properties that enable workload balancing and the maximum number of connections.
Java™ client applications support transaction-level workload balancing. They do not support connection-level workload balancing. Workload balancing is supported only for connections to a Db2 pureScale instance.
Workload balancing support for Java client
applications that connect to Db2 on Linux, UNIX, and Windows systems works
for connections that are obtained using the javax.sql.DataSource, javax.sql.ConnectionPoolDataSource, javax.sql.XADataSource
,
or java.sql.DriverManager interface.
- Alternate server information is shared between DriverManager connections only if you create the connections with the same URL and properties.
- You cannot set the clientRerouteServerListJNDIName property or the clientRerouteServerListJNDIContext properties for a DriverManager connection.
- Workload balancing is not enabled for default connections (jdbc:default:connection).
The following table describes the basic property settings for enabling Db2 on Linux, UNIX, and Windows systems workload balancing for Java applications.
IBM Data Server Driver for JDBC and SQLJ setting | Value |
---|---|
enableSysplexWLB property | true |
maxTransportObjects property | The maximum number of connections that the requester can make to the Db2 pureScale instance |
Connection address: server | The IP address of a member of a Db2 pureScale instance1 |
Connection address: port | The SQL port number for the Db2 pureScale instance1 |
Connection address: database | The database name |
Note:
|
If you want to fine-tune Db2 on Linux, UNIX, and Windows systems workload balancing support, global configuration properties are available. The properties for the IBM Data Server Driver for JDBC and SQLJ are listed in the following table.
IBM Data Server Driver for JDBC and SQLJ configuration property | Description |
---|---|
db2.jcc.maxRefreshInterval | Specifies the maximum amount of time in seconds between refreshes of the client copy of the server list that is used for workload balancing. The default is 10. The minimum valid value is 1. |
db2.jcc.maxTransportObjectIdleTime | Specifies the maximum elapsed time in number of seconds before an idle transport is dropped. The default is 10. The minimum supported value is 0. |
db2.jcc.maxTransportObjectWaitTime | Specifies the number of seconds that the client will wait for a transport to become available. The default is 1. The minimum supported value is 0. |
db2.jcc.minTransportObjects | Specifies the lower limit for the number of transport objects in a global transport object pool. The default value is 0. Any value that is less than or equal to 0 means that the global transport object pool can become empty. |