org.cementj.base.trans
Class J2EETransactionContext

java.lang.Object
  extended by org.cementj.support.trans.AbstractTransactionContext
      extended by org.cementj.base.trans.J2EETransactionContext
All Implemented Interfaces:
TransactionContext

public class J2EETransactionContext
extends org.cementj.support.trans.AbstractTransactionContext
implements TransactionContext

Implementation of a TransactionContext suitable for applications running inside a J2EE container. This is also usable to locally debug classes typically running in a J2EE container that manage transactions.

Copyright: Delta Vortex Technologies, 2003.


Constructor Summary
protected J2EETransactionContext()
           
  J2EETransactionContext(javax.ejb.EJBContext sessionContext)
           
 
Method Summary
 void begin()
          Demarks the beginning of a transaction.
 void commitAll()
          Commits your JTA transaction (or all JDBC transactions) in progress.
 java.sql.Connection getNewConnection(java.lang.String connectPoolName)
          Provides a JDBC connection given an identifying label.
 void rollbackAll()
          Issues rollbacks for your JTA transaction (or all JDBC transactions) in progress.
 
Methods inherited from class org.cementj.support.trans.AbstractTransactionContext
closeAll, getConnection, getRegisteredConnection, registerAllocatedConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.cementj.base.trans.TransactionContext
closeAll, getConnection
 

Constructor Detail

J2EETransactionContext

protected J2EETransactionContext()

J2EETransactionContext

public J2EETransactionContext(javax.ejb.EJBContext sessionContext)
Method Detail

getNewConnection

public java.sql.Connection getNewConnection(java.lang.String connectPoolName)
                                     throws TransactionException
Description copied from interface: TransactionContext
Provides a JDBC connection given an identifying label. For applications running under a J2EE container, this label is typically your database connection pool name.

A new connection will be created and returned regardless of other connections previously created by this context.

It is imperitive that you don't issue commits, rollbacks, or close connections received from a TransactionContext. Those tasks should be done via the TransactionContext.

Specified by:
getNewConnection in interface TransactionContext
Specified by:
getNewConnection in class org.cementj.support.trans.AbstractTransactionContext
Returns:
Throws:
TransactionException

commitAll

public void commitAll()
               throws TransactionException
Description copied from interface: TransactionContext
Commits your JTA transaction (or all JDBC transactions) in progress.

Specified by:
commitAll in interface TransactionContext
Overrides:
commitAll in class org.cementj.support.trans.AbstractTransactionContext
Throws:
TransactionException

rollbackAll

public void rollbackAll()
                 throws TransactionException
Description copied from interface: TransactionContext
Issues rollbacks for your JTA transaction (or all JDBC transactions) in progress.

Specified by:
rollbackAll in interface TransactionContext
Overrides:
rollbackAll in class org.cementj.support.trans.AbstractTransactionContext
Throws:
TransactionException

begin

public void begin()
           throws TransactionException
Description copied from interface: TransactionContext
Demarks the beginning of a transaction.

Specified by:
begin in interface TransactionContext
Overrides:
begin in class org.cementj.support.trans.AbstractTransactionContext
Throws:
TransactionException


Copyright © 2003 Delta Vortex Technologies, Inc. All Rights Reserved.