With the SQLExceptionOverride it is already possible to prevent the eviction of a connection.
What we are missing is the opposite: Force the eviction based on an SQLException that would by default not trigger an eviction.
While it would probably be possible to make the ERROR_STATES and ERROR_CODES configurable, it would probably make more sense to have a feature like the SQLExceptionOverride or even extend the existing feature by moving the call of SQLExceptionOverride#adjudicate up, out of the surrounding if and adding a FORCE_EVICT entry to the enum.
Another suggestion from an existing issue was to allow overriding the complete checkException(SQLException) method, but I guess that would be harder to use and would be another different concept for a very similar use-case. See https://github.com/brettwooldridge/HikariCP/issues/2015
With the
SQLExceptionOverride
it is already possible to prevent the eviction of a connection. What we are missing is the opposite: Force the eviction based on anSQLException
that would by default not trigger an eviction.While it would probably be possible to make the
ERROR_STATES
andERROR_CODES
configurable, it would probably make more sense to have a feature like theSQLExceptionOverride
or even extend the existing feature by moving the call ofSQLExceptionOverride#adjudicate
up, out of the surroundingif
and adding aFORCE_EVICT
entry to the enum.Another suggestion from an existing issue was to allow overriding the complete
checkException(SQLException)
method, but I guess that would be harder to use and would be another different concept for a very similar use-case. See https://github.com/brettwooldridge/HikariCP/issues/2015Original use-case: https://github.com/brettwooldridge/HikariCP/issues/2185