@Deprecated public interface SmartConnectionFactory extends ConnectionFactory
io.r2dbc.spi.ConnectionFactory
interface, to be implemented by special connection factories
that return R2DBC Connections in an unwrapped fashion.
Classes using this interface can query whether or not the Connection
should be closed after an operation.
Spring's ConnectionFactoryUtils
automatically perform such a check.
ConnectionFactoryUtils.closeConnection(io.r2dbc.spi.Connection, io.r2dbc.spi.ConnectionFactory)
Modifier and Type | Method and Description |
---|---|
boolean |
shouldClose(Connection connection)
Deprecated.
Should we close this
Connection , obtained from this io.r2dbc.spi.ConnectionFactory ? |
create, getMetadata
boolean shouldClose(Connection connection)
Connection
, obtained from this io.r2dbc.spi.ConnectionFactory
?
Code that uses Connections from a SmartConnectionFactory should always perform a check via this method before
invoking close()
.
connection
- the Connection
to check.Connection
should be closed.Connection.close()
Copyright © 2018–2022 Pivotal Software, Inc.. All rights reserved.