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 void
begin()
Create a new transaction and associate it with the current thread.void
complete()
Complete the transaction : either commit or rollback.long
getNumberOfActiveTransactions()
Get the number of active transactions (i.e.boolean
isRollbackOnly()
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.-
Methods inherited from interface org.bonitasoft.engine.transaction.UserTransactionService
executeInTransaction, hasMultipleResources, isTransactionActive, registerBeforeCommitCallable, registerBonitaSynchronization
-
-
-
-
Method Detail
-
begin
void begin() throws STransactionCreationException
Create a new transaction and associate it with the current thread.- Throws:
STransactionCreationException
-
complete
void complete() throws STransactionCommitException, STransactionRollbackException
Complete the transaction : either commit or rollback.
-
setRollbackOnly
void setRollbackOnly() throws STransactionException
Modify 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
-
-