spring-projects-experimental/spring-fu

Upgrade to leverage R2dbcProperties and official R2DBC Boot support

Closed this issue · 4 comments

Use official configuration available as of Spring Boot 2.3 instead of manual configuration done currently. Likely to provide a unified r2dbc configuration block for all databases instead of current r2dbcH2/r2dbcPostgresql.

We should check that ConnectionFactory is exposed as asked in #262.

See also spring-projects/spring-data-r2dbc#378.

@aneveu @sdeleuze Hi and thanks for this nice feature.

Considering this article reactive transactions with Spring we should use a TransactionalOperator to manage transactional queries.
New R2dbcInitializer only registers a DatabaseClient Bean in Spring Context.

Shouldn't R2dbcInitializer also register TransactionalOperator as Bean in Spring context, or maybe just expose the ConnectionFactory so we can create a TransactionalOperator from it like this ?

ConnectionFactory factory = …
ReactiveTransactionManager tm = new R2dbcTransactionManager(factory);
TransactionalOperator to = TransactionalOperator.create(tm);

@aneveu @sdeleuze Hi and thanks for this nice feature.

Considering this article reactive transactions with Spring we should use a TransactionalOperator to manage transactional queries.
New R2dbcInitializer only registers a DatabaseClient Bean in Spring Context.

Shouldn't R2dbcInitializer also register TransactionalOperator as Bean in Spring context, or maybe just expose the ConnectionFactory so we can create a TransactionalOperator from it like this ?

ConnectionFactory factory = …
ReactiveTransactionManager tm = new R2dbcTransactionManager(factory);
TransactionalOperator to = TransactionalOperator.create(tm);

You're right, thanks for the suggestion! We're gonna add a boolean flag to let users enable the transactional mode and though retrieve the TransactionalOperator.

Thanks a lot @aneveu and @fteychene !