This blog gives you
a detailed approach to configure a DataSource, JNDI, DBAdapter, and its
underlying technologies, facts and common issues.
component used in a SOA Application has to be a service, and this applies to
the database also. A database by itself cannot act as a service that can be
exposed to the service. Inorder to use
the database in a SOA application, you need to expose it as a service in some
Oracle SOA Suite
provides you this capability by using a JCA-build wrapper called the DBAdapter.
Using this adapter
in your application is quite straight forward, provided it is configured
developers come across errors like
Please make sure that the JCA connection factory and any
dependent connection factories have been configured with a sufficient limit for
max connections. Please also make sure that the physical connection to the
backend EIS is available and the backend
itself is accepting connections.
The invoked JCA adapter raised a resource exception.
Please examine the above error message carefully to determine
while working with the DBAdapters. This is due
to incorrect setup of the adapter.
Datasource setup is
a one time step, and it is always good to know the underlying steps and
Before we go to the
steps in configuring a DBAdapter, lets have a look at the various concepts
involved in this.
A datasource, as its name implies, is anything
that acts as a source for data. Database is a source of data, and it has to be
configured as a datasource to the SOA infrastrucure.
specific to the Weblogic Server is the connection to the actual underlying data
communicates with the database through a connection pool. The connection pool
enables WebLogic to use a fixed number of connections to databases rather than
incur the overhead of constantly
creating and disposing of connections.
A data source has a
connection pool attached to it, which it uses for connecting to the actual data
provider(Database in this case). While creating a datasource, you give a JNDI
name, which is used by the JNDI infrastructure
to call the datasource.
JNDI, the Java
Naming and Directory Interface is a standard interface for the Java based
application clients to access the underlying naming and directory services.
This forms a wrapper
over the underlying naming and directory services like DNS, LDAP, etc. and lets
the client access different services in a standard way.
is independent of any specific naming or directory service implementations, and
allows any service provider implementations to be plugged into the JNDI
framework using the standard Service
are basically 3 steps inorder to setup and configure a DBAdapter in a SOA
- Configure a datasource for the underlying database,
associate a JNDI name to it.
- Configure an outbound
connection pool, and link it with the datasource using the same JNDI name.
- Use this JNDI name while
configuring the DB Adapter.
Step 1 : Configure a Datasource for the
underlying Database, associate a JNDI name to it
step is done using the Weblogic Admin Console. Please make sure your database
is up and running before this step.
--> Services --> Data Sources --> New --> Generic Data Source
Standard naming convention for database sources would have a
JNDI name prefixed with "jdbc/". You will use this name later to
associate a connection pool to this datasource.
Give the underlying
Database details, test the connection in the next screen(not shown here)
Select the server
that is running the SOA infrastructure. This makes this datasource to run on
that particular server, making this available to all the apps running on that
Click on finish.
After this, you should see this newly configured datasource in the Data Sources
Now that the
datasource is setup, and a JNDI name associated to it,
you need to create a
connection pool for this datasource, in other words connections to this
Step 2 : Configure an outbound connection pool, link
it to the datasource using the JNDI name
In Weblogic Admin
Deployments --> dbAdapter --> Configuration --> Outbound Connection
Pools --> New
In the above screen,
you are giving a new JNDI name, and this will be used in the SOA Suite's
DBAdapter configuration wizard to obtain reference to this connection pool.
Now, you can see the
newly configured JNDI name in the list of Outbound Connection Pools.
This new connection
pool has to be linked to the datasource that you've created before.
There might be a bit
confusion in the JNDI names. Here is how it is.
Both the datasource
and Connection Pool has their specific JNDI Names
myDataSource has a JNDI Name
has a JNDI Name
and this connection pool will use the name jdbc/myDataSource as its
xaDataSourceName, and hence the linking to the datasource is done
After this setup,
you need to redeploy the dbAdapter
Select the DBAdapter
in deployments, Update-->Redeploy
Step 3 : Use this JNDI name while configuring the DB
While setting up the
DBAdapter in the SOA Suite, in the configuration wizard, use the same JNDI Name
I Hope it is clear
now what all goes into a dbAdapter setup.
My next post explains about working with a DatabaseAdapter in Oracle SOA Suite 11g
Thanks for going through my post, feel free to provide a feedback!