transactionManager

@Bean
@ConditionalOnMissingBean(value = [TransactionManager::class])
open fun transactionManager(dataSource: DataSource, customizers: ObjectProvider<TransactionManagerCustomizers>): OctaviusJdbcTransactionManager

Creates and registers an OctaviusJdbcTransactionManager if the application context declares no TransactionManager of its own - JDBC, JPA or reactive alike, as for Boot's own. Declared as the class it is, so a bean created before it can inject it by that type.

It does for the DataSource what DataSourceTransactionManager does, and adds the driver's own exception for a transaction that failed to begin, commit or roll back, an answer for one whose connection has already left - see the class for which way each of commit and rollback goes, and why they differ - and a transaction timeout that is enforced.

Boot's transaction manager customizers are applied to it, as they are to the one Boot would have made: spring.transaction.default-timeout and spring.transaction.rollback-on-commit-failure reach it, and so does a TransactionManagerCustomizer<OctaviusJdbcTransactionManager> bean - the way to change its OctaviusJdbcTransactionManager.timeoutScope without declaring the manager yourself.

Return

a new instance of OctaviusJdbcTransactionManager

Parameters

dataSource

the underlying data source to use

customizers

Boot's transaction manager customizers, where Boot's transaction auto-configuration provides them