Package org.dalesbred.integration.spring
Class SpringTransactionManager
java.lang.Object
org.dalesbred.integration.spring.SpringTransactionManager
- All Implemented Interfaces:
TransactionManager
ConnectionProvider which integrates with Spring's transaction management.
Usually application code should not need this class, but use DalesbredConfigurationSupport to
integrate with Spring.
-
Constructor Summary
ConstructorsConstructorDescriptionSpringTransactionManager(@NotNull DataSource dataSource, @NotNull PlatformTransactionManager platformTransactionManager) Constructs new SpringTransactionManager to use. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the code is executing inside transaction.<T> TwithCurrentTransaction(@NotNull TransactionCallback<T> callback, @NotNull Dialect dialect) Executes given callback within current transaction.<T> TwithTransaction(@NotNull TransactionSettings settings, @NotNull TransactionCallback<T> callback, @NotNull Dialect dialect) Executes given callback with given transaction settings.
-
Constructor Details
-
SpringTransactionManager
public SpringTransactionManager(@NotNull @NotNull DataSource dataSource, @NotNull @NotNull PlatformTransactionManager platformTransactionManager) Constructs new SpringTransactionManager to use.
-
-
Method Details
-
withCurrentTransaction
public <T> T withCurrentTransaction(@NotNull @NotNull TransactionCallback<T> callback, @NotNull @NotNull Dialect dialect) Description copied from interface:TransactionManagerExecutes given callback within current transaction.- Specified by:
withCurrentTransactionin interfaceTransactionManager
-
withTransaction
public <T> T withTransaction(@NotNull @NotNull TransactionSettings settings, @NotNull @NotNull TransactionCallback<T> callback, @NotNull @NotNull Dialect dialect) Description copied from interface:TransactionManagerExecutes given callback with given transaction settings.- Specified by:
withTransactionin interfaceTransactionManager
-
hasActiveTransaction
public boolean hasActiveTransaction()Description copied from interface:TransactionManagerReturns true if the code is executing inside transaction.- Specified by:
hasActiveTransactionin interfaceTransactionManager
-