org.openejb.corba.services.transaction
Class Transaction

java.lang.Object
  |
  +--org.openejb.corba.services.transaction.Transaction
All Implemented Interfaces:
javax.transaction.Transaction

public class Transaction
extends java.lang.Object
implements javax.transaction.Transaction

This class represents a transaction. It gives the ability to register or unregister an XA resource, but also the possibility to demarcate a transaction. Restriction : to be able to manage XA resource from this class, it is required to use OpenORB OTS that provides a JTA compatibility ( support of javax.transaction.xa.XAResource )


Constructor Summary
Transaction(org.omg.CosTransactions.Current curr, org.omg.PortableServer.POA poa, org.omg.CORBA.ORB orb)
          Constructor
 
Method Summary
 void commit()
          Commit the current transaction
 boolean delistResource(javax.transaction.xa.XAResource resource, int flag)
          Delist a resource from the current transaction
 boolean enlistResource(javax.transaction.xa.XAResource resource)
          Enlist a new resource for the current transaction.
 boolean equals(java.lang.Object obj)
           
 int getStatus()
          Return the transaction status.
 void registerSynchronization(javax.transaction.Synchronization synchro)
          Register a new synchronization object
 void rollback()
          Rollback a transaction
 void setRollbackOnly()
          Set the current transaction to be only rolledback
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transaction

public Transaction(org.omg.CosTransactions.Current curr,
                   org.omg.PortableServer.POA poa,
                   org.omg.CORBA.ORB orb)
Constructor
Method Detail

commit

public void commit()
            throws javax.transaction.RollbackException,
                   javax.transaction.HeuristicMixedException,
                   javax.transaction.HeuristicRollbackException,
                   java.lang.SecurityException,
                   java.lang.IllegalStateException,
                   javax.transaction.SystemException
Commit the current transaction
Specified by:
commit in interface javax.transaction.Transaction

delistResource

public boolean delistResource(javax.transaction.xa.XAResource resource,
                              int flag)
                       throws java.lang.IllegalStateException,
                              javax.transaction.SystemException
Delist a resource from the current transaction
Specified by:
delistResource in interface javax.transaction.Transaction

enlistResource

public boolean enlistResource(javax.transaction.xa.XAResource resource)
                       throws javax.transaction.RollbackException,
                              java.lang.IllegalStateException,
                              javax.transaction.SystemException
Enlist a new resource for the current transaction.
Specified by:
enlistResource in interface javax.transaction.Transaction

getStatus

public int getStatus()
              throws javax.transaction.SystemException
Return the transaction status.
Specified by:
getStatus in interface javax.transaction.Transaction

registerSynchronization

public void registerSynchronization(javax.transaction.Synchronization synchro)
                             throws javax.transaction.RollbackException,
                                    java.lang.IllegalStateException,
                                    javax.transaction.SystemException
Register a new synchronization object
Specified by:
registerSynchronization in interface javax.transaction.Transaction

rollback

public void rollback()
              throws java.lang.IllegalStateException,
                     java.lang.SecurityException,
                     javax.transaction.SystemException
Rollback a transaction
Specified by:
rollback in interface javax.transaction.Transaction

setRollbackOnly

public void setRollbackOnly()
                     throws java.lang.IllegalStateException,
                            javax.transaction.SystemException
Set the current transaction to be only rolledback
Specified by:
setRollbackOnly in interface javax.transaction.Transaction

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object