Allow to delegate the clearing of JDBC warnings on Connection close to the Connection Pool implementor
Description
Activity
Show:
Details
Details
Assignee
Sanne Grinovero
Sanne GrinoveroReporter
Sanne Grinovero
Sanne GrinoveroComponents
Fix versions
Priority
Created February 26, 2020 at 1:19 PM
Updated September 30, 2020 at 5:31 PM
We noticed that:
Invoking
java.sql.Connection#clearWarnings
is not very efficient on several JDBC driversHibernate 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 toorg.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.ConnectionProviderJdbcConnectionAccess#supportsAggressiveRelease