You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before working with r2dbc, I had some experience with Hibernate Reactive and they expose a pattern like this:
sessionFactory.withSession(
session -> /// do something with the session
)
where the user doesn't have to worry about creating or closing the session. Would it be possible to add something similar to the ConnectionFactory interface.
Describe the solution you'd like
Perhaps the solution method could look something like:
If introduced, this would not replace any methods already declared in the ConnectionFactory interface and could potentially be introduced as a default method in the interface so that each implementation of ConnectionFactory would not need to write it.
The text was updated successfully, but these errors were encountered:
I also wondered whether this would be a good enhancement for R2DBC Pool. I moved the ticket into the Pool project because the SPI Spec doesn't depend on Project Reactor while the Pool implementation has a direct dependency on Project Reactor.
Would you want to craft a pull request that introduces methods returning Mono/Flux on the ConnectionPool class? withConnection/withConnectionMany might be good candidates naming-wise.
Feature Request
Is your feature request related to a problem? Please describe
It seems a recommended pattern for working with a
ConnectionFactory
is to write something likeBefore working with r2dbc, I had some experience with Hibernate Reactive and they expose a pattern like this:
where the user doesn't have to worry about creating or closing the session. Would it be possible to add something similar to the
ConnectionFactory
interface.Describe the solution you'd like
Perhaps the solution method could look something like:
Describe alternatives you've considered
The alternative is to continue using the boilerplate above wherever we need to work with a connection.
Teachability, Documentation, Adoption, Migration Strategy
If introduced, this would not replace any methods already declared in the ConnectionFactory interface and could potentially be introduced as a default method in the interface so that each implementation of ConnectionFactory would not need to write it.
The text was updated successfully, but these errors were encountered: