CA IDMS JDBC for Two Phase Commit

Document ID : KB000044429
Last Modified Date : 14/02/2018
Show Technical Document Details

Introduction: 

Some applications want to update a CA IDMS database as well as another database, and coordinate those updates as a single unit of recovery. In order to do that, a process called a two-phase commit is required.

Question: 

How can java-based applications use the CA IDMS Server with a JDBC interface and establish a two-phased commit?

Environment:  

Any environment that include a CA IDMS database.

Answer: 

In order to use two-phase commit with Java you need to use JDBC in addition to a Transaction Manager. The more common approach is to use a local (Web Server Based) Transaction Manager. The Transaction Manager is used to coordinate the transactions across multiple databases. In our testing we used JBOSS and WebSphere. 

 

Eclipse also supports transaction management. Please see the following page on the Eclipse Wiki: 
http://www.eclipse.org/jetty/documentation/current/jndi-configuration.html 
Have a look at the section entitled Configuring XA Transactions. Here’s a snippet: 

If you want to perform distributed transactions with your resources, you need a transaction manager that supports the JTA interfaces, and that you can look up as java:comp/UserTransaction in your webapp. Jetty does not ship with one as standard, but you can plug in the one you prefer. You can configure a transaction manager using the JNDI Transaction object in a Jetty config file. The following example configures the Atomikos transaction manager: 

<New id="tx" class="org.eclipse.jetty.plus.jndi.Transaction"> 
<Arg> 
<New class="com.atomikos.icatch.jta.J2eeUserTransaction"/> 
</Arg> 
</New>