|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TransactionContext
Abstracts transaction control so that classes can be deployment independent. Transaction control for J2EE applications differ from normal Java applications. Consequently it difficult to write applications that can either work with or without a J2EE container.
TransactionContext decouples an application from the way transaction control is managed. Most classes using a TransactionContext for transaction control will be able to function outside a container as they do inside a container.
This interface is meant to be used in conjunction with class BusinessLogicObject from package org.cementj.base.
Copyright: Delta Vortex Technologies, 2003.
Method Summary | |
---|---|
void |
begin()
Demarks the beginning of a transaction. |
void |
closeAll()
Closes all associated database connections. |
void |
commitAll()
Commits your JTA transaction (or all JDBC transactions) in progress. |
java.sql.Connection |
getConnection(java.lang.String label)
Provides a JDBC connection given an identifying label. |
java.sql.Connection |
getNewConnection(java.lang.String label)
Provides a JDBC connection given an identifying label. |
void |
rollbackAll()
Issues rollbacks for your JTA transaction (or all JDBC transactions) in progress. |
Method Detail |
---|
java.sql.Connection getConnection(java.lang.String label) throws TransactionException
If a connection has previously been created by this transaction context for this identifying label, that connection will be returned. A new connection will not be created. If you explicitly want a new connection, use getNewConnection().
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.
label
-
TransactionException
java.sql.Connection getNewConnection(java.lang.String label) throws TransactionException
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.
label
-
TransactionException
void commitAll() throws TransactionException
TransactionException
void rollbackAll() throws TransactionException
TransactionException
void begin() throws TransactionException
TransactionException
void closeAll() throws TransactionException
TransactionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |