Open mozguletz opened 6 months ago
Existing implementation of AbstractR2DBCQuery.fetch() and unsafeCount() takes an existing connection from the connection provider and uses it, in case if a connection pool is used, the connections are never closed
AbstractR2DBCQuery.fetch()
unsafeCount()
return getConnection() .flatMapMany( conn -> { ...});
A way to handle the close connection (returning it to the pool)
return Flux.usingWhen(getConnection(), conn -> { ...}, Connection::close);
Is there a way to close the connection from the connection provider in case if a connection pool is used?
@mozguletz uuuups.
My bad.
Are you able to submit a pull request fixing it?
Cheers
@velo @mozguletz I'll try to fix it.
Existing implementation of
AbstractR2DBCQuery.fetch()
andunsafeCount()
takes an existing connection from the connection provider and uses it, in case if a connection pool is used, the connections are never closedreturn getConnection() .flatMapMany( conn -> { ...});
A way to handle the close connection (returning it to the pool)
return Flux.usingWhen(getConnection(), conn -> { ...}, Connection::close);
Is there a way to close the connection from the connection provider in case if a connection pool is used?