IBM Integration Bus, Version 9.0.0.8 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

Configuring a JDBC type 4 connection for globally coordinated transactions

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.

Before you start: Set up your JDBC provider definition.
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:

  1. Check that the definition of your JDBCProvider service is appropriate for coordinated transactions.

    For example, to set up the required JDBC classes:

    • For 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.
  2. Define the switch file and the database properties:
    1. Linux platformUNIX platformOn Linux and UNIX systems, open the qm.ini file for the broker 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 broker. 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.

    2. Windows platformOn Windows on x86 systems, open WebSphere® MQ Explorer and select the queue manager for your broker, 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 the fully qualified file name in SwitchFile; install_dir\bin\JDBCSwitch.dll.

    3. Windows platformOn Windows on x86-64 systems, open WebSphere MQ Explorer and select the queue manager for your broker, 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.

  3. Set up queue manager access to the switch file:
    1. Linux platformUNIX platformOn Linux and UNIX systems, create a symbolic link to the switch files that are supplied in your install_dir/lib directory.

      install_dir is the directory to which you installed the Integration Bus component. The default location for this directory is /opt/ibm/mqsi/v.r.m.f on Linux, or /opt/IBM/mqsi/v.r.m.f 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).

      On all Linux and UNIX systems except Linux on x86, set up links in the /var/mqm/exits64 directory.

      On Linux on x86, set up links in the /var/mqm/exits 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 or /exits directory, as relevant. For example, on AIX®:

      ln -s install_dir/lib/libJDBCSwitch.so /var/mqm/exits64/JDBCSwitch
    2. Windows platformOn Windows, for the 32-bit version of IBM® Integration Bus, copy the JDBCSwitch.dll file from the install_dir\bin directory to the \exits subdirectory in the WebSphere MQ installation directory.
    3. Windows platformOn Windows, for the 64-bit version of IBM Integration Bus, copy the JDBCSwitch32.dll file from the install_dir\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\bin directory to the \exits64 subdirectory in the WebSphere MQ installation directory.
  4. Configure the message flow that includes one or more nodes that access databases that are to participate in a globally coordinated transaction.
    1. Open an IBM Integration Toolkit session.
    2. Switch to the Integration Development perspective.
    3. 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.
    4. Build the BAR file.
    5. Click the Configure tab, select the message flow that you have added, and select the Coordinated Transaction check box.
Next: If your broker is running on Windows, authorize the broker and its queue manager to access resources associated with the JDBCProvider configurable service.

If you have been following the instructions in Working with databases, the next task is Configuring ODBC connections for globally coordinated transactions (optional).


ah61330_.htm | Last updated Friday, 21 July 2017