Package org.dalesbred.integration.spring
Class SpringTransactionManager
- java.lang.Object
-
- org.dalesbred.integration.spring.SpringTransactionManager
-
- All Implemented Interfaces:
TransactionManager
public final class SpringTransactionManager extends java.lang.Object implements TransactionManager
ConnectionProviderwhich integrates with Spring's transaction management.Usually application code should not need this class, but use
DalesbredConfigurationSupportto integrate with Spring.
-
-
Constructor Summary
Constructors Constructor Description SpringTransactionManager(@NotNull javax.sql.DataSource dataSource, @NotNull PlatformTransactionManager platformTransactionManager)Constructs new SpringTransactionManager to use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasActiveTransaction()Returns 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 Detail
-
SpringTransactionManager
public SpringTransactionManager(@NotNull @NotNull javax.sql.DataSource dataSource, @NotNull @NotNull PlatformTransactionManager platformTransactionManager)Constructs new SpringTransactionManager to use.
-
-
Method Detail
-
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
-
-