Interface TransactionManager
- All Known Implementing Classes:
TransactionManagerAdapter
public interface TransactionManager
Entry point into the transaction subsystem.
-
Method Summary
Modifier and TypeMethodDescriptionbegin()
Begin a new transaction in the current context.ensure()
Ensure that there is a transaction in the context.@Nullable Transaction
Get the current transaction of the context.Get the current transaction of the context.
-
Method Details
-
begin
Begin a new transaction in the current context.- Returns:
- The new transaction
- Throws:
IllegalStateException
- If there is already an active transaction in the current context.
-
ensure
Transaction ensure()Ensure that there is a transaction in the context. If there is already an active transaction in the current context, no action will be taken, otherwise, a new one will be started.- Returns:
- The current transaction.
-
getCurrent
Get the current transaction of the context.- Returns:
- The current transaction or
null
, if there is no active transaction.
-
requireCurrent
Transaction requireCurrent()Get the current transaction of the context.- Returns:
- The current transaction.
- Throws:
IllegalStateException
- if current == null
-