R2DBC ConnectionFactory bean .close()
method should be called/subscribed when available
#26991
Labels
Milestone
When Spring Boot autoconfiguration instantiates
io.r2dbc.spi.ConnectionFactory
bean implementingio.r2dbc.spi.Closeable
, the framework should have a custom destruction method invokeCloseable.close()
and subscribe to the returnedPublisher
.If a user application creates its own
ConnectionFactory
, it would be the user's responsibility to then close it. Although it might be nice to have a generic pre-destruction facility that looks for all R2DBCCloseable
beans and closes them cleanly. The regular Spring bean destruction mechanism won't work here, since Spring Framework would call.close()
but not subscribe to it, making it a no-op.cc: @mp911de
The text was updated successfully, but these errors were encountered: