简体   繁体   中英

running XA/JTA transactions from z/OS batch jobs

Using JZOS launcher to execute java programs in batch.

The DB2 driver for JDBC supports XA transactions but it seems that it's only possible to use them when the process is running under the control of a "transaction manager" (what happens when running a WebSphere/CICS process)

Is there a way to use this kind of transactions in batch?

The target is mixing DB2/Oracle inserts/updates in a single commit/rollback

The ibm site provides an example (see Figure 3 - Example of a distributed transaction that uses the JTA) with the transaction management logic included

This seems to be possible only when using type 4 (remote) connectivity to DB2

SimpleJTA is a project that could be used directly to solve the problem or as a reference for the purposed encapsulation:

SimpleJTA implements a standalone JTA compliant Transaction Manager. It is primarily designed to be used when a J2EE server is not available, for example, in Servlet applications, or standalone Java programs.

But it should be adapted/configured to use DB2

SimpleJTA is being developed and tested with Oracle 9i and Apache Derby database management systems. It is fairly easy to add support for other database systems that support the XA interface.

A more complex problem is to do this job with type 2 (native/DLL) connectivity to DB2 because it does not support distributed transactions. This could be necessary if you want to integrate updates from a JNI invoked COBOL program in the distributed transaction

Perhaps a solution similar to the last participant support extension of WebSphere could be builded:

Last participant support is an extension to the transaction service to allow a single one-phase resource to participate in a two-phase transaction with one or more two-phase resources.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM