An Oracle Weblogic Multi Data Source is an abstraction around a Data Source that provides load balancing or failover processing between the Data Sources associated with the multi data source. Oracle Weblogic Multi Data Sources are bound to the JNDI tree or local application context just like ordinary Data Sources are bound to the JNDI tree. Applications lookup a multi Data Source on the JNDI tree or in the local application context (java:comp/env) just like they do for Data Sources and then request a database connection.
The multi Data Source determines which Data Source to use depending on the algorithm selected in the multi Data Source configuration. This can be either load balancing or failover.
With the Load-Balancing option, connection requests are evenly distributed among available Data Sources; With the Failover option, connection requests are served by the first available pool in the list.
When a Data Source becomes defunct, connection requests are served by the next Data Source in the list. In order to set up a multi data source follow these steps:
1. Create, at first, the individual Data Source just as we showed in the earlier recipes.
2. Next, from the Data Sources menu, choose to add a new Multi Data Source:
3. In the Create a New JDBC Multi Data Source screen, enter the multi Data Source Name and its JNDI Name. Select the Algorithm Type as Load-Balancing (or Failover).
Click Next. In the following screen, select the servers you are going to target the Data Source and move next. As shown by the following screen, you will need to choose the type of Data Source (XA or non-XA):
Click Next. Finally, pick up the Data Sources that will be part of this multi Data Source and click the right arrow to move them from “Available” to “Chosen”.
Click Finish to complete the Oracle Weblogic multi Data Source creation.