A multi data source is an abstraction around a group of data sources that provides load balancing or failover processing between the data sources associated with the multi data source. Multi data sources are bound to the JNDI tree or local application context just like data sources are bound to the JNDI tree. The Multi Data Source can be used in the same way as we use a Data Source.
When an application requests a connection, the Multi Data Source determines which data source will provide a connection based on the selected algorithm.
Connection requests to a load-balancing multi data source are served from any data source in the list. The multi data source selects data sources to use to satisfy connection requests using a round-robin scheme. When the multi data source provides a connection, it selects a connection from the data source listed just after the last data source that was used to provide a connection. Multi data sources that use the Load Balancing algorithm also fail over to the next data source in the list if a database connection test fails and the connection cannot be replaced, or if the data source is suspended.
The Failover algorithm provides an ordered list of data sources to use to satisfy connection requests. Normally, every connection request to this kind of multi data source is served by the first data source in the list. If a database connection test fails and the connection cannot be replaced, or if the data source is suspended, a connection is sought sequentially from the next data source on the list.
With the Failover algorithm, this attribute enables failover when all connections in a data source are in use.
This attribute controls the frequency at which Weblogic Server checks the health of data sources previously marked as unhealthy to see if connections can be recreated and if the data source can be re-enabled.
High Level Steps: Create two or more generic data sources, and then create a Multi Data Source and assign data sources to the Multi Data Source.
a)Create Generic Data Sources(3 in our case) as we normally create with NAME and JNDI NAME as required .
b) Create a MULTI Data Sources.
>> Choose the 3 Generic data sources from available datasources to right side.
Target the Multi Data Source to relevant Servers.