Getting Connections with Clustered JDBC Failover and Load Balancing for JDBC Connections

2-6 Using Clusters for Oracle WebLogic Server For more information about JDBC, see Configuring WebLogic JDBC Resources in Configuring and Managing JDBC for Oracle WebLogic Server.

2.5.3.1 Getting Connections with Clustered JDBC

To ensure that any JDBC request can be handled equivalently by any cluster member, each Managed Server in the cluster must have similarly nameddefined data sources, if applicable, multi data sources. To achieve this result, data sources and multi data sources should be targeted to the cluster so they are cluster-aware and, if intended for use in external clients, their connections can be to any cluster members. ■ External Clients Connections—External clients that require a database connection perform a JNDI lookup and obtain a replica-aware stub for the data source. The stub for the data source contains a list of the server instances that host the data source—which should be all of the Managed Servers in the cluster. Replica-aware stubs contain load balancing logic for distributing the load among host server instances. ■ Server-Side Client Connections—For server-side use, connection requests will be handled by the local instance of the data source or multi data source. A server-side data source will not go to another cluster member for its JDBC connections. The connection is pinned to the local server instance for the duration of the database transaction, and as long as the application code retains it until the connection is closed.

2.5.3.2 Failover and Load Balancing for JDBC Connections

Clustering your JDBC objects does not enable failover of connections, but it can ease the process of reconnecting when a connection fails. In replicated database environments, multi data sources may be clustered to support database failover, and optionally, load balancing of connections. See the following topics for more information: ■ To understand the behavior of clustered JDBC objects when failures occur, see Section 6.4, Failover and JDBC Connections. ■ To learn more about how clustered multi data sources enable load balancing of connections, see Section 5.4, Load Balancing for JDBC Connections. ■ For instructions on configuring clustered JDBC objects, see Section 10.2.12, Configure Clustered JDBC.

2.5.4 JMS and Clustering