Package org.dalesbred.transaction
Class AbstractTransactionManager
java.lang.Object
org.dalesbred.transaction.AbstractTransactionManager
- All Implemented Interfaces:
TransactionManager
- Direct Known Subclasses:
DefaultTransactionManager
,SingleConnectionTransactionManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract @NotNull Optional<org.dalesbred.transaction.DefaultTransaction>
boolean
Returns true if the code is executing inside transaction.<T> T
withCurrentTransaction
(@NotNull TransactionCallback<T> callback, @NotNull Dialect dialect) Executes given callback within current transaction.protected abstract <T> T
withNewTransaction
(@NotNull TransactionCallback<T> callback, @NotNull Dialect dialect, @NotNull Isolation isolation) protected abstract <T> T
withSuspendedTransaction
(@NotNull TransactionCallback<T> callback, @NotNull Isolation isolation, @NotNull Dialect dialect) <T> T
withTransaction
(@NotNull TransactionSettings settings, @NotNull TransactionCallback<T> callback, @NotNull Dialect dialect) Executes given callback with given transaction settings.
-
Constructor Details
-
AbstractTransactionManager
public AbstractTransactionManager()
-
-
Method Details
-
getActiveTransaction
@NotNull protected abstract @NotNull Optional<org.dalesbred.transaction.DefaultTransaction> getActiveTransaction() -
withNewTransaction
protected abstract <T> T withNewTransaction(@NotNull @NotNull TransactionCallback<T> callback, @NotNull @NotNull Dialect dialect, @NotNull @NotNull Isolation isolation) -
withSuspendedTransaction
protected abstract <T> T withSuspendedTransaction(@NotNull @NotNull TransactionCallback<T> callback, @NotNull @NotNull Isolation isolation, @NotNull @NotNull Dialect dialect) -
withTransaction
public <T> T withTransaction(@NotNull @NotNull TransactionSettings settings, @NotNull @NotNull TransactionCallback<T> callback, @NotNull @NotNull Dialect dialect) Description copied from interface:TransactionManager
Executes given callback with given transaction settings.- Specified by:
withTransaction
in interfaceTransactionManager
-
withCurrentTransaction
public <T> T withCurrentTransaction(@NotNull @NotNull TransactionCallback<T> callback, @NotNull @NotNull Dialect dialect) Description copied from interface:TransactionManager
Executes given callback within current transaction.- Specified by:
withCurrentTransaction
in interfaceTransactionManager
-
hasActiveTransaction
public boolean hasActiveTransaction()Description copied from interface:TransactionManager
Returns true if the code is executing inside transaction.- Specified by:
hasActiveTransaction
in interfaceTransactionManager
-