|
[Deprecated API] | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | CURRENT API | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.interface21.transaction.support.AbstractPlatformTransactionManager
Abstract class that allows for easy implementation of PlatformTransactionManager. Provides the following case handling:
setAllowNonTransactionalExecution(boolean),
setTransactionSynchronization(boolean)| Field Summary | |
protected org.apache.commons.logging.Log |
logger
|
| Constructor Summary | |
AbstractPlatformTransactionManager()
|
|
| Method Summary | |
void |
commit(TransactionStatus status)
This implementation of commit handles programmatic rollback requests, i.e. status.isRollbackOnly(), and non-transactional execution. |
protected abstract void |
doBegin(java.lang.Object transaction,
int isolationLevel,
int timeout)
Begin a new transaction with the given isolation level. |
protected abstract void |
doCommit(TransactionStatus status)
Perform an actual commit on the given transaction. |
protected abstract java.lang.Object |
doGetTransaction()
Return a current transaction object, i.e. a JTA UserTransaction. |
protected abstract void |
doRollback(TransactionStatus status)
Perform an actual rollback on the given transaction. |
protected abstract void |
doSetRollbackOnly(TransactionStatus status)
Set the given transaction rollback-only. |
boolean |
getAllowNonTransactionalExecution()
Return if transaction support does not need to be available. |
TransactionStatus |
getTransaction(TransactionDefinition definition)
This implementation of getTransaction handles propagation behavior and checks non-transactional execution (on CannotCreateTransactionException). |
boolean |
getTransactionSynchronization()
Return if this transaction manager should activate the thread-bound transaction synchronization support. |
protected abstract boolean |
isExistingTransaction(java.lang.Object transaction)
Check if the given transaction object indicates an existing, i.e. already begun, transaction. |
void |
rollback(TransactionStatus status)
This implementation of rollback handles participating in existing transactions and non-transactional execution. |
void |
setAllowNonTransactionalExecution(boolean allowNonTransactionalExecution)
Set if transaction support does not need to be available, e.g. when JTA isn't available in the container. |
void |
setTransactionSynchronization(boolean transactionSynchronization)
Set if this transaction manager should activate the thread-bound transaction synchronization support. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected final org.apache.commons.logging.Log logger
| Constructor Detail |
public AbstractPlatformTransactionManager()
| Method Detail |
public final void setAllowNonTransactionalExecution(boolean allowNonTransactionalExecution)
public final boolean getAllowNonTransactionalExecution()
public final void setTransactionSynchronization(boolean transactionSynchronization)
Note that transaction synchronization isn't supported for multiple concurrent transactions. Only one transaction manager is allowed to activate it at any time.
TransactionSynchronizationManagerpublic final boolean getTransactionSynchronization()
public final TransactionStatus getTransaction(TransactionDefinition definition)
throws TransactionException
getTransaction in interface PlatformTransactionManagercom.interface21.transaction.PlatformTransactionManagerdefinition - TransactionDefinition instance (can be null for defaults),
describing propagation behavior, isolation level, timeout etc.TransactionException - in case of lookup, creation, or system errors
public final void commit(TransactionStatus status)
throws TransactionException
commit in interface PlatformTransactionManagercom.interface21.transaction.PlatformTransactionManagerstatus - object returned by the getTransaction() method.TransactionException - in case of commit or system errors
public final void rollback(TransactionStatus status)
throws TransactionException
rollback in interface PlatformTransactionManagercom.interface21.transaction.PlatformTransactionManagerstatus - object returned by the getTransaction() method.TransactionException - in case of system errors
protected abstract java.lang.Object doGetTransaction()
throws CannotCreateTransactionException,
TransactionException
CannotCreateTransactionException - if transaction support is
not available (e.g. no JTA UserTransaction retrievable from JNDI)TransactionException - in case of lookup or system errors
protected abstract boolean isExistingTransaction(java.lang.Object transaction)
throws TransactionException
transaction - transaction object returned by doGetTransaction()TransactionException - in case of system errors
protected abstract void doBegin(java.lang.Object transaction,
int isolationLevel,
int timeout)
throws TransactionException
transaction - transaction object returned by doGetTransaction()isolationLevel - desired isolation leveltimeout - transaction timeout (in seconds)TransactionException - in case of creation or system errors
protected abstract void doCommit(TransactionStatus status)
throws TransactionException
status - status representation of the transactionTransactionException - in case of commit or system errors
protected abstract void doRollback(TransactionStatus status)
throws TransactionException
status - status representation of the transactionTransactionException - in case of system errors
protected abstract void doSetRollbackOnly(TransactionStatus status)
throws TransactionException
status - status representation of the transactionTransactionException - in case of system errors
|
[Deprecated API] | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | CURRENT API | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||