Class JTATransactionServiceImpl
java.lang.Object
org.bonitasoft.engine.transaction.JTATransactionServiceImpl
- All Implemented Interfaces:
TransactionService,UserTransactionService
-
Constructor Summary
ConstructorsModifierConstructorDescriptionJTATransactionServiceImpl(javax.transaction.TransactionManager txManager) protectedJTATransactionServiceImpl(javax.transaction.TransactionManager txManager, XAResourceRetriever xaResourceRetriever) -
Method Summary
Modifier and TypeMethodDescriptionvoidbegin()Create a new transaction and associate it with the current thread.voidcomplete()Complete the transaction : either commit or rollback.<T> TexecuteInTransaction(Callable<T> callable) Execute the given callable inside a transaction.longGet the number of active transactions (i.e.booleanbooleanvoidregisterBeforeCommitCallable(Callable<Void> callable) voidregisterBonitaSynchronization(javax.transaction.Synchronization txSync) Register a synchronization object for the transaction currently associated with the target object.voidModify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
-
Constructor Details
-
JTATransactionServiceImpl
public JTATransactionServiceImpl(javax.transaction.TransactionManager txManager) -
JTATransactionServiceImpl
protected JTATransactionServiceImpl(javax.transaction.TransactionManager txManager, XAResourceRetriever xaResourceRetriever)
-
-
Method Details
-
begin
Description copied from interface:TransactionServiceCreate a new transaction and associate it with the current thread.- Specified by:
beginin interfaceTransactionService- Throws:
STransactionCreationException
-
complete
Description copied from interface:TransactionServiceComplete the transaction : either commit or rollback.- Specified by:
completein interfaceTransactionService- Throws:
STransactionCommitExceptionSTransactionRollbackException
-
isTransactionActive
public boolean isTransactionActive()- Specified by:
isTransactionActivein interfaceUserTransactionService
-
setRollbackOnly
Description copied from interface:TransactionServiceModify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.- Specified by:
setRollbackOnlyin interfaceTransactionService- Throws:
STransactionException- Thrown if the transaction manager encounters an unexpected error condition.
-
isRollbackOnly
- Specified by:
isRollbackOnlyin interfaceTransactionService- Throws:
STransactionException
-
registerBonitaSynchronization
public void registerBonitaSynchronization(javax.transaction.Synchronization txSync) throws STransactionNotFoundException Description copied from interface:UserTransactionServiceRegister a synchronization object for the transaction currently associated with the target object. The transaction manager invokes the beforeCompletion method prior to starting the two-phase transaction commit process. After the transaction is completed, the transaction manager invokes the afterCompletion method.- Specified by:
registerBonitaSynchronizationin interfaceUserTransactionService- Parameters:
txSync- The Synchronization object for the transaction associated with the target object.- Throws:
STransactionNotFoundException- Thrown if the transaction manager encounters an unexpected error condition.
-
registerBeforeCommitCallable
public void registerBeforeCommitCallable(Callable<Void> callable) throws STransactionNotFoundException - Specified by:
registerBeforeCommitCallablein interfaceUserTransactionService- Throws:
STransactionNotFoundException
-
executeInTransaction
Description copied from interface:UserTransactionServiceExecute the given callable inside a transaction.- Specified by:
executeInTransactionin interfaceUserTransactionService- Returns:
- Throws:
Exception
-
getNumberOfActiveTransactions
public long getNumberOfActiveTransactions()Description copied from interface:TransactionServiceGet the number of active transactions (i.e. transactions that opened but not yet completed or rolledback). A transaction that was just mark as "rollbackOnly" is considered as an active one.- Specified by:
getNumberOfActiveTransactionsin interfaceTransactionService- Returns:
- the number of active transactions
-
hasMultipleResources
- Specified by:
hasMultipleResourcesin interfaceUserTransactionService
-