Created recently

Allow to delegate the clearing of JDBC warnings on Connection close to the Connection Pool implementor

Description

We noticed that:

  • Invoking java.sql.Connection#clearWarnings is not very efficient on several JDBC drivers

  • Hibernate ORM clears such warnings before closing each connection and returning it to the connection pool

  • Some connection pool implementations such as Agroal (and likely most others too?) will also clear such warnings when the connection is returned to the pool.

It seems sensible to allow this clearWarnings operation to happen once at most; since this capability depends on the Connection Pool I will introduce a new flag on the pool: at this stage I don't expect to make this a configurable user property, but allow the implementors of ConnectionProvider to hint about this capability: similarly to org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.ConnectionProviderJdbcConnectionAccess#supportsAggressiveRelease

Environment

None

Assignee

Sanne Grinovero

Reporter

Sanne Grinovero

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Major
Configure