Thursday, August 6, 2015

Difference between WebLogic Server "DbAdapter" and "Data Source" connection pool parameters

For users of Oracle SOA Suite 11g/12c, this blog will attempt to answer whether you should configure your connection pool settings at the adapter level or at the data source level.


Data Source Settings

On Oracle WebLogic Server 11g/12c, navigate to Data Sources > SOADataSource > Configuration > General.

Here, you can obtain the JNDI, such as jdbc/SOADataSource. This JNDI is generally handed to your developers so that they can use it from within their Java code. Keep in mind that this JNDI is also used by the DbAdapter (explained later).


Now click on the Connection Pool tab. Here, you can see the various settings of the connection pool such as the initial and maximum number of connections which you can adjust as necessary.



DbAdapter Settings

Now navigate to Deployments > DbAdapter > Configuration > Outbound Connection Pools > [expand javax.resource.cci.ConnectionFactory] > eis/DB/SOADemo > General. Here, you can obtain the JNDI, such as eis/DB/SOADemo, which is passed on to your SOA developers. Your SOA developers typically use this from within their SOA or OSB code.

(Note that Oracle SOA Suite deploys various JCA adapters as part of the installation of the product.)



Now click on the Properties tab. As you can see here, the connection factory is really based off of the data source (i.e., you are required to reference a data source).



Finally, click on the Connection Pool tab. Here, you also have initial and maximum connection pool settings which you can adjust as necessary.



The Question

The "Max Capacity" setting under the connection factory's connection pool is set to 1000 and under the data source's connection pool is set to 20. Which one actually takes effect?



The Explanation

The JCA connection factory settings and data source settings are totally different settings.

JCA connection pools are to connect to JCA Adapters (such as the DbAdapter, JmsAdapter, etc.). Data Source connection pools are to connect to the database.

When the "Max Capacity" setting under the connection factory's connection pool is set to 1000, this means that you have 1000 available connections to connect to the JCA adapters. This means that your SOA or OSB code has up to 1000 connections to the JCA adapter (not the database).

When the data source's connection pool is set to a maximum value of 20, this means that you have a maximum of 20 connections to connect to the Database.

Generally, the default settings of the JCA connection factory should be sufficient. However, you may need to adjust your Data Source connection pool settings depending on your needs.



Applicable Versions:
  • Oracle WebLogic Server 11g/12c
  • Oracle SOA Suite 11g/12c


4 comments:

Ramesh Audireddy said...
This comment has been removed by the author.
Ramesh Audireddy said...

Hi Ahmed,

Could you please explain to me the below Queries.

Datasource is also providing the connection to the DB thenwWhy we are using DBAdapter instead of the Datasource in SOA services for connecting to the DB?

Thank and Regards,
Ramesh

Ahmed Aboulnaga said...

In your SOA code, you have no choice but to use the DBAdapter.

With that being said, reread the section titled "The Explanation" in the blog post which explains the difference. If it's still not clear, let me know. I'll admit it's a bit confusing at first.

Thanks.

Ramesh Audireddy said...

Hi Ahmed,

Thanks for the information...

Thanks and Regards,
Ramesh A