Class TransactionManagerAdapter
java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.legacy.TransactionManagerAdapter
- All Implemented Interfaces:
TransactionManager
Handles transactions based on a hibernate
Session-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbegin()Begin a new transaction in the current context.ensure()Ensure that there is a transaction in the context.@Nullable TransactionGet the current transaction of the context.Get the current transaction of the context.
-
Constructor Details
-
TransactionManagerAdapter
-
-
Method Details
-
begin
Description copied from interface:TransactionManagerBegin a new transaction in the current context.- Specified by:
beginin interfaceTransactionManager- Returns:
- The new transaction
- Throws:
IllegalStateException- If there is already an active transaction in the current context.
-
ensure
Description copied from interface:TransactionManagerEnsure 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.- Specified by:
ensurein interfaceTransactionManager- Returns:
- The current transaction.
-
getCurrent
Description copied from interface:TransactionManagerGet the current transaction of the context.- Specified by:
getCurrentin interfaceTransactionManager- Returns:
- The current transaction or
null, if there is no active transaction.
-
requireCurrent
Description copied from interface:TransactionManagerGet the current transaction of the context.- Specified by:
requireCurrentin interfaceTransactionManager- Returns:
- The current transaction.
-