arjuna logoarjuna strap line


print this page
email this page

Assuming that the Arjuna Transactioning product has been installed, this trail provides a set of examples that show how to build transactional applications. Two types of transactional applications are presented, those using the JTA interface and those accessing to the JTS (OTS) interfaces.

Please follow these steps before running the transactional applications

  • Ensure you have the Ant build system installed. Ant is a Java build tool, similar to make. It is available for free from http://ant.apache.org/ The sample application requires version 1.5.1 or later.
  • The PATH and CLASSPATH environment variables need to be set appropriately to use Arjuna Transaction Service. To make this easier, we provide a shell script setup_env.sh (and for Windows a batch file setup_env.bat) in the directory <arjunats_install_root>/bin/
  • From a command prompt, cd to the directory containing the build.xml file (<arjunats_install_root>/trail_map) and type 'ant', unless already done in the installation section . This will compile a set of sources files located under <arjunats_install_root>/trail_map/src then create an application .jar file named arjunats-demo.jar. under the directory <arjunats_install_root>/trail_map/lib
  • Add the generated jar file to the CLASSPATH environment variable.
  • The demo application is provided in several ways, accessing persistent data or not. When JDBC is used as a mean to access a database, Oracle 9i is used. For this aim the appropriate Oracle libraries (classes12.zip) should be add in the CLASSPATH environment variable.

Local transaction with JTA
To configure ATS for such transaction, edit the arjunajts-properties.xml file and set the following properties to the appropriate values:
  <property name="com.arjuna.ats.jta.jtaTMImplementation" 
           value="com.arjuna.ats.internal.jta.transaction.
                         arjunacore.TransactionManagerImple"/>
  <property name="com.arjuna.ats.jta.jtaUTImplementation" 
           value="com.arjuna.ats.internal.jta.transaction.
                         arjunacore.UserTransactionImple"/>
Distributed transaction with JTA
While for a distributed transactions case, ATS need to be configured as follow:
  <property name="com.arjuna.ats.jta.jtaTMImplementation" 
           value="com.arjuna.ats.internal.jta.transaction.
                         jts.TransactionManagerImple"/>
  <property name="com.arjuna.ats.jta.jtaUTImplementation" 
           value="com.arjuna.ats.internal.jta.transaction.
                         jts.UserTransactionImple"/>
Using JTA to create a distributed transaction need the creation of an ORB instance as done by a JTS application (see JTS versions of the banking application), the difference is in the interface used to demarcate and control transactions.

The application programming interfaces used by the Banking Application

To illustrate the programming interfaces possibilities enabled by ArjunaTS, the banking application is provided in several versions: a version that uses the JTA API and a second that uses JTS/OTS interfaces.

This trail focuses to understanding concepts related to the creation of transactions and the behavior of the commitment protocol, while the next trail illustrates the similar application with persistent data.

Copyright 2002-2005 Arjuna Technologies All Rights Reserved.
info@arjuna.com +44 191 243 0676