I'm going to port a Web application from Oracle Weblogic Server 11 to Websphere 8.5. One issue that I have found is that the WLS application uses a feature called "Multi Data Source" where multiple JDBC Connections are available as a single Component (thus providing a more robust access to the database).
Is there an equivalent solution also for Websphere or a workaround I can use to emulate it ?
Thanks a lot
Louis
Checking WLS documentation;
A multi data source can be thought of as a pool of data sources. Multi data sources are best used for failover or load balancing between nodes of a highly available database system, such as redundant databases or Oracle Real Application Clusters (RAC).
As far as I know, such a facility does not exist at WAS. Nonetheless, you may achieve same result by using a load balanced JDBC connection string. An example for Oracle RAC may look like (quoting Oracle documentation);
jdbc:oracle:thin@(DESCRIPTION=
(LOAD_BALANCE=on)
(ADDRESS=(PROTOCOL=TCP)(HOST=racnode1) (PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=racnode2) (PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=service_name)))
What you shall do is to define a single, normal datasource at WAS at the scope that you prefer, and configure the load balanced JDBC connection string as above (sample here load balances two RAC nodes).
The load balancing functionality, configured as above, is provided by the JDBC driver provided by database vendor, so you shall check your database documentation for support if you're using a different database.
Edit: A correction to my answer is in order. I came across this functionality, which is indeed a new feature in WAS8, called Resource workload routing. Below is the description;
Resource workload routing includes data source and connection factory fail over and subsequent fail back from a predefined alternate or backup resource. This function enables applications to easily recover from resource outages, such as database failures, without requiring you to embed alternate resource and configuration information. You can tailor the resource fail over and failback flexible configuration options to meet your environment-specific and application needs.
You simple configure this new feature by adding custom properties to your datasource. The main property in this feature is;
alternateResourceJNDIName
Values: String value containing a direct JNDI name.
Description: An alternate connection factory or data source resource
should be like the primary resource. Provide the JNDI name of the
alternate resource to enable the fail over feature.