| This interface is a representative for the javax.transaction.Transaction object. It only
contains the COMPONENT_URL for use when application code wants to acess javax.transaction.Transaction
Note that the average complexity business level application should use javax.transaction.UserTransaction for simple
transaction management (begin, commit, rollback, getStatus ) functionality. The javax.transaction.Transaction is too low level
and should only be used for system level purposes (i.e. joining unsupported XA resources). This is why
this object is not available in some parts of the system, particularly clients. For example simple java application,
which runs in separate JVM and is a client to JBoss application server will not have access to the Transaction object
(it will, however, have access to UserTransaction object). Given all of this, in order to remain platform independent and
portable, Transaction object should only be used in middle tiers of the system and not at the client.
To access JTA's Transaction object in platform independent way :
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.transaction.Transaction;
...............................
...............................
Context lContext = new javax.naming.InitialContext();
Transaction lTransaction = (Transaction)lContext.lookup(com.metaboss.enterprise.transaction.Transaction.COMPONENT_URL);
|