If you want the database that you access through a JDBC
type 4 connection to participate in globally coordinated transactions,
set up the appropriate environment.
About this task
On distributed systems, a WebSphere® MQ queue manager associated with
the integration node performs the transaction manager role, which
means that IBM® Integration Bus requires access
to WebSphere MQ when processing messages.
For more information about using WebSphere MQ with IBM Integration Bus, see Installing WebSphere MQ.
Updates
that you make to a database across a JDBC type 4 connection can be
coordinated with other actions taken within the message flow, if you
set up the resources to support coordination.
Complete the
following steps:
Procedure
- Check that the definition of your JDBCProvider
service is appropriate for coordinated transactions.
For
example, to set up the required JDBC classes:
- For IBM
DB2®, set type4DatasourceClassName to
com.ibm.db2.jcc.DB2XADataSource
and type4DriverClassName to com.ibm.db2.jcc.DB2Driver
- For Oracle, set type4DatasourceClassName to
oracle.jdbc.xa.client.OracleXADataSource
and type4DriverClassName to oracle.jdbc.OracleDriver
Consult your database administrator or the documentation provided
by your database supplier, to confirm that all the JDBCProvider service
properties are set appropriately. For example, a database supplier
might require secure access if it is participating in coordinated
transactions.
- Define the switch file and the database properties:
- The JDBC switch file is supplied by IBM Integration Bus, and uses static XA registration
(see Configuring databases for global coordination of transactions).
- On Linux® and UNIX systems, open the qm.ini file
for the integration node queue manager with a text editor. Add the
following stanza for each database:
XAResourceManager:
Name=Database_Name
SwitchFile=JDBCSwitch
XAOpenString=JDBC_DataSource
ThreadOfControl=THREAD
Database_Name is the database name
(DSN) of the database defined to the JDBCProvider configurable service
(for example, specified by -n databaseName -v Database_Name
on
the mqsichangeproperties command).
JDBCSwitch
is
a fixed generic name that represents the switch file for XA coordination.
Use this value, or another single fixed value, in each stanza; the
specific switch file that the queue manager uses is defined by the
symbolic links you create in the next step.
JDBC_DataSource is
the identifier of the JDBCProvider configurable service (the value
that you specified for the -o parameter on the mqsichangeproperties command).
Define
a stanza for each database (DSN) that you connect to from this integration
node. You must create separate definitions even if the DSNs resolve
to the same physical database. Therefore, you must have a stanza for
each JDBCProvider configurable service that you have defined, because
each service can define the properties for a single database.
- On Windows, open WebSphere MQ Explorer and select the queue
manager for your integration node, for example BROKERQM.
Open
the XA resource manager page, and modify the
attributes to create the definition of the database. The attributes
are the same as those shown for Linux and UNIX; Name, SwitchFile, XAOpenString,
and ThreadofControl. Leave the additional attribute, XACloseString,
blank.
Enter JDBCSwitch in SwitchFile.
- Set up queue manager access to the switch file:
- On Linux and UNIX systems, create a symbolic link
to the switch files that are supplied in your install_dir/server/lib directory.
install_dir is
the directory to which you installed IBM Integration Bus.
The default location for this directory is install_dir/iib-10.0.0.n/server on Linux, or /opt/IBM/mqsi/10.0.0.n/server on UNIX systems. The default directory includes the version,
release, modification, and fix of the product, in the format v.r.m.f
(version.release.modification.fix).
Set
up links in the /var/mqm/exits64 directory. The
file name for all platforms is libJDBCSwitch.so.
Specify
the same name of the switch file, JDBCSwitch
or your
own value, in the /exits64 directory. For example,
on AIX®:
ln -s install_dir/server/lib/libJDBCSwitch.so /var/mqm/exits64/JDBCSwitch
- On Windows, copy the JDBCSwitch32.dll file
from the install_dir\server\bin directory
to the \exits subdirectory in the WebSphere MQ installation directory, and
rename the file to JDBCSwitch.dll. Then, copy
the JDBCSwitch.dll file from the install_dir\server\bin directory
to the \exits64 subdirectory in the WebSphere MQ installation directory.
- Configure the message flow that includes one or more nodes
that access databases that are to participate in a globally coordinated
transaction.
- Open an IBM Integration Toolkit session.
- Switch to the Integration Development
perspective.
- Add the message flow that includes the node or nodes
that connect to the database that is to participate in a globally
coordinated transaction to a new or existing BAR file.
- Build the BAR file.
- Click the Configure tab, select
the message flow that you have added, and select the Coordinated
Transaction check box.