org.compass.core.transaction
Class AbstractJTATransaction

java.lang.Object
  extended by org.compass.core.transaction.AbstractTransaction
      extended by org.compass.core.transaction.AbstractJTATransaction
All Implemented Interfaces:
CompassTransaction, InternalCompassTransaction
Direct Known Subclasses:
JTASyncTransaction, XATransaction

public abstract class AbstractJTATransaction
extends AbstractTransaction

Author:
kimchy

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.compass.core.CompassTransaction
CompassTransaction.TransactionIsolation
 
Constructor Summary
AbstractJTATransaction(UserTransaction ut)
           
 
Method Summary
 void begin(InternalCompassSession session, TransactionManager transactionManager, CompassTransaction.TransactionIsolation transactionIsolation)
           
protected abstract  void doBindToTransaction(Transaction tx, InternalCompassSession session, boolean newTransaction)
           
protected  void doCommit()
           
protected  void doRollback()
           
 void join()
          Called by the factory when joining an already running compass transaction
 boolean wasCommitted()
          Check if this transaction was successfully committed.
 boolean wasRolledBack()
          Was this transaction rolled back or set to rollback only?
 
Methods inherited from class org.compass.core.transaction.AbstractTransaction
commit, isBegun, rollback, setBegun
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJTATransaction

public AbstractJTATransaction(UserTransaction ut)
Method Detail

begin

public void begin(InternalCompassSession session,
                  TransactionManager transactionManager,
                  CompassTransaction.TransactionIsolation transactionIsolation)
           throws CompassException
Throws:
CompassException

doBindToTransaction

protected abstract void doBindToTransaction(Transaction tx,
                                            InternalCompassSession session,
                                            boolean newTransaction)
                                     throws Exception
Throws:
Exception

join

public void join()
          throws CompassException
Called by the factory when joining an already running compass transaction

Throws:
CompassException

doCommit

protected void doCommit()
                 throws CompassException
Specified by:
doCommit in class AbstractTransaction
Throws:
CompassException

doRollback

protected void doRollback()
                   throws CompassException
Specified by:
doRollback in class AbstractTransaction
Throws:
CompassException

wasRolledBack

public boolean wasRolledBack()
                      throws TransactionException
Description copied from interface: CompassTransaction
Was this transaction rolled back or set to rollback only?

Returns:
If the transaction was rolled backed
Throws:
TransactionException

wasCommitted

public boolean wasCommitted()
                     throws TransactionException
Description copied from interface: CompassTransaction
Check if this transaction was successfully committed. This method could return false even after successful invocation of commit().

Returns:
If the transaction was committed
Throws:
TransactionException


Copyright (c) 2004-2006 The Compass Project.