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
-
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.
-
Constructor Details
-
TransactionManagerAdapter
-
-
Method Details
-
begin
Description copied from interface:TransactionManager
Begin a new transaction in the current context.- Specified by:
begin
in interfaceTransactionManager
- Returns:
- The new transaction
- Throws:
IllegalStateException
- If there is already an active transaction in the current context.
-
ensure
Description copied from interface:TransactionManager
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.- Specified by:
ensure
in interfaceTransactionManager
- Returns:
- The current transaction.
-
getCurrent
Description copied from interface:TransactionManager
Get the current transaction of the context.- Specified by:
getCurrent
in interfaceTransactionManager
- Returns:
- The current transaction or
null
, if there is no active transaction.
-
requireCurrent
Description copied from interface:TransactionManager
Get the current transaction of the context.- Specified by:
requireCurrent
in interfaceTransactionManager
- Returns:
- The current transaction.
-