public class JTATransactionServiceImpl extends java.lang.Object implements TransactionService
| Modifier and Type | Field and Description |
|---|---|
protected TechnicalLoggerService |
logger |
| Constructor and Description |
|---|
JTATransactionServiceImpl(TechnicalLoggerService logger,
javax.transaction.TransactionManager txManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
begin()
Create a new transaction and associate it with the current thread.
|
void |
complete()
Complete the transaction : either commit or rollback.
|
static TransactionState |
convert(int status) |
<T> T |
executeInTransaction(java.util.concurrent.Callable<T> callable)
Execute the given callable inside a transaction.
|
long |
getNumberOfActiveTransactions()
Get the number of active transactions (i.e.
|
TransactionState |
getState()
Obtain the status of the transaction associated with the current thread.
|
boolean |
isRollbackOnly() |
boolean |
isTransactionActive() |
void |
registerBeforeCommitCallable(java.util.concurrent.Callable<java.lang.Void> callable) |
void |
registerBonitaSynchronization(BonitaTransactionSynchronization txSync)
Register a synchronization object for the transaction currently
associated with the target object.
|
void |
setRollbackOnly()
Modify the transaction associated with the current thread such that
the only possible outcome of the transaction is to roll back the
transaction.
|
protected final TechnicalLoggerService logger
public JTATransactionServiceImpl(TechnicalLoggerService logger, javax.transaction.TransactionManager txManager)
public static TransactionState convert(int status)
public void begin()
throws STransactionCreationException
TransactionServicebegin in interface TransactionServiceSTransactionCreationExceptionpublic void complete()
throws STransactionCommitException,
STransactionRollbackException
TransactionServicecomplete in interface TransactionServiceSTransactionCommitExceptionSTransactionRollbackExceptionpublic TransactionState getState() throws STransactionException
TransactionServicegetState in interface TransactionServiceSTransactionException - Thrown if the transaction manager
encounters an unexpected error condition.public boolean isTransactionActive()
isTransactionActive in interface UserTransactionServicepublic void setRollbackOnly()
throws STransactionException
TransactionServicesetRollbackOnly in interface TransactionServiceSTransactionException - Thrown if the transaction manager
encounters an unexpected error condition.public boolean isRollbackOnly()
throws STransactionException
isRollbackOnly in interface TransactionServiceSTransactionExceptionpublic void registerBonitaSynchronization(BonitaTransactionSynchronization txSync) throws STransactionNotFoundException
UserTransactionServiceregisterBonitaSynchronization in interface UserTransactionServicetxSync - The Synchronization object for the transaction associated
with the target object.STransactionNotFoundException - Thrown if the transaction manager
encounters an unexpected error condition.public void registerBeforeCommitCallable(java.util.concurrent.Callable<java.lang.Void> callable)
throws STransactionNotFoundException
registerBeforeCommitCallable in interface UserTransactionServiceSTransactionNotFoundExceptionpublic <T> T executeInTransaction(java.util.concurrent.Callable<T> callable)
throws java.lang.Exception
UserTransactionServiceexecuteInTransaction in interface UserTransactionServicejava.lang.Exceptionpublic long getNumberOfActiveTransactions()
TransactionServicegetNumberOfActiveTransactions in interface TransactionService