Skip to content

Add any TransactionExecutionListener beans to the auto-configured transaction manager #36770

@wilkinsona

Description

@wilkinsona

Suggestion from Juergen:

Boot could automatically inject any TransactionExecutionListener beans in the context into a PlatformTransactionManager or ReactiveTransactionManager that it configures, along the following lines:

@Bean
public JdbcTransactionManager transactionManager(DataSource dataSource, Collection<TransactionExecutionListener transactionExecutionListeners) {
   JdbcTransactionManager tm = new JdbcTransactionManager();
   tm.setDataSource(dataSource);
   tm.setTransactionExecutionListeners(transactionExecutionListeners);
   return tm;
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions