com.scooterframework.transaction
Interface Transaction

All Known Implementing Classes:
AbstractTransactionImpl, CmtTransaction, JdbcTransaction, JtaTransaction

public interface Transaction

Transaction interface provides methods for managing transaction boundaries.


Field Summary
static java.lang.String CMT_TRANSACTION_TYPE
           
static java.lang.String JDBC_TRANSACTION_TYPE
           
static java.lang.String JTA_TRANSACTION_TYPE
           
static java.lang.String USER_TRANSACTION_JNDI_STRING
           
 
Method Summary
 void begin()
          Start a transaction.
 void commit()
          Commit a transaction.
 UserDatabaseConnection getConnection()
          Return a connection to the database
 UserDatabaseConnection getConnection(DatabaseConnectionContext dcc)
          Return a connection based on connection context
 UserDatabaseConnection getConnection(java.lang.String connectionName)
          Return a connection to the database
 boolean isTransactionEnded()
          Check if transaction has ended.
 boolean isTransactionStarted()
          Check if transaction has started.
 void releaseResources()
          Release all resources managed by this transaction.
 void rollback()
          Rollback a transaction.
 

Field Detail

CMT_TRANSACTION_TYPE

static final java.lang.String CMT_TRANSACTION_TYPE
See Also:
Constant Field Values

JDBC_TRANSACTION_TYPE

static final java.lang.String JDBC_TRANSACTION_TYPE
See Also:
Constant Field Values

JTA_TRANSACTION_TYPE

static final java.lang.String JTA_TRANSACTION_TYPE
See Also:
Constant Field Values

USER_TRANSACTION_JNDI_STRING

static final java.lang.String USER_TRANSACTION_JNDI_STRING
See Also:
Constant Field Values
Method Detail

releaseResources

void releaseResources()
Release all resources managed by this transaction. This method should always be called at the end of a transaction block.


begin

void begin()
Start a transaction.


commit

void commit()
Commit a transaction.


rollback

void rollback()
Rollback a transaction.


isTransactionStarted

boolean isTransactionStarted()
Check if transaction has started.


isTransactionEnded

boolean isTransactionEnded()
Check if transaction has ended.


getConnection

UserDatabaseConnection getConnection()
Return a connection to the database

Returns:
UserDatabaseConnection

getConnection

UserDatabaseConnection getConnection(java.lang.String connectionName)
Return a connection to the database

Parameters:
connectionName - name of a connection
Returns:
UserDatabaseConnection

getConnection

UserDatabaseConnection getConnection(DatabaseConnectionContext dcc)
Return a connection based on connection context

Parameters:
dcc - An DatanaseConnectionContext object
Returns:
Connection