Interface TransactionService
-
- All Superinterfaces:
UserTransactionService
- All Known Implementing Classes:
JTATransactionServiceImpl
public interface TransactionService extends UserTransactionService
- Author:
- Matthieu Chaffotte, Laurent Vaills
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbegin()Create a new transaction and associate it with the current thread.voidcomplete()Complete the transaction : either commit or rollback.longgetNumberOfActiveTransactions()Get the number of active transactions (i.e.booleanisRollbackOnly()voidsetRollbackOnly()Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.-
Methods inherited from interface org.bonitasoft.engine.transaction.UserTransactionService
executeInTransaction, hasMultipleResources, isTransactionActive, registerBeforeCommitCallable, registerBonitaSynchronization
-
-
-
-
Method Detail
-
begin
void begin() throws STransactionCreationExceptionCreate a new transaction and associate it with the current thread.- Throws:
STransactionCreationException
-
complete
void complete() throws STransactionCommitException, STransactionRollbackExceptionComplete the transaction : either commit or rollback.
-
setRollbackOnly
void setRollbackOnly() throws STransactionExceptionModify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.- Throws:
java.lang.IllegalStateException- Thrown if the current thread is not associated with a transaction.STransactionException- Thrown if the transaction manager encounters an unexpected error condition.
-
isRollbackOnly
boolean isRollbackOnly() throws STransactionException- Throws:
STransactionException
-
getNumberOfActiveTransactions
long getNumberOfActiveTransactions()
Get 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.- Returns:
- the number of active transactions
-
-