#################
#               #
# basic example #
#               #
#################

# $Id: README.txt,v 1.11 2003/01/13 14:17:05 jmesnil Exp $


Scenario:
---------

The basic example is a very simple example showing how to
setup and use a transaction manager on either RMI/JRMP or RMI/IIOP

Setup:
------

o a name server (RMI registry or IIOP nameserver)
o JOTM is the Transaction Manager

o BasicExample is the client using UserTransaction.
  it makes 2 transactions:
  - the first one with a commit result
  - the second one is rolled back because of the expiration
    of a transaction timeout

Compilation:
------------

Set JOTM_HOME to the directory of your JOTM distribution (e.g.,
.../jotm/output/dist from CVS)

To compile the example, type

   $ ant compile

Run the example on RMI/JRMP:
----------------------------

To run the example on RMI/JRMP, type $JOTM_HOME/lib/ directory

   $ rmiregistry -J-classpath -Jjotm.jar:jotm_jrmp_stubs.jar -J-Djava.security.policy=../config/java.policy &

In $JOTM_HOME/lib/ directory, type

   $ java -classpath jotm.jar:jotm_jrmp_stubs.jar:../config/ org.objectweb.jotm.Main -u UserTransaction &

In the basic/ directory, type

   $ ant run.rmi.jrmp

Run the example on RMI/IIOP:
----------------------------

To run the example on RMI/IIOP, first change the setting of JOTM
to activate RMI/IIOP support:

o in ../../config/carol.properties, change carol.rmi.activated:

   carol.rmi.activated=iiop
   (only RMI/IIOP is activated and is the default protocol)

Then type

   $ tnameserv -ORBInitialPort 19751 &

In $JOTM_HOME/lib/ directory, type

   $ java -classpath jotm.jar:jotm_iiop_stubs.jar:../config/ org.objectweb.jotm.Main -u UserTransaction &

In the basic/ directory, type

   $ ant run.rmi.iiop

Run the example on both RMI/JRMP and RMI/IIOP:
----------------------------------------------

To run the example on RMI/IIOP, first change the setting of JOTM
to activate RMI/IIOP support:

o in ../../config/carol.properties, change carol.rmi.activated:

   carol.rmi.activated=jrmp,iiop
   (both RMI/IIOP and RMI/JRMP are activated and RMI/JRMP
   is the default protocol)

o then type in $JOTM_HOME/lib/ directory

   $ rmiregistry -J-classpath -Jjotm.jar:jotm_jrmp_stubs.jar -J-Djava.security.policy=../config/java.policy &
   $ tnameserv -ORBInitialPort 19751 &
   
o in $JOTM_HOME/lib/ directory, type

   $ java -classpath jotm.jar:jotm_jrmp_stubs.jar:jotm_iiop_stubs.jar:../config/ org.objectweb.jotm.Main -u UserTransaction &

o finally you can acces JOTM on both RMI/JRMP or RMI/IIOP. In the
  basic/ directory, type

   $ ant run.rmi.jrmp
   $ ant run.rmi.iiop

Enjoy!





