-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ability to set exceptionOverride instance, not just class name #2171
Comments
quaff
added a commit
to quaff/HikariCP
that referenced
this issue
Feb 20, 2024
…loaded Before this commit, exceptionOverrideClass may be loaded by different ClassLoader, and two instances are created but only the latter one is used. This commit make sure the class will only loaded once and only one instance is created. Fix brettwooldridgeGH-2124 Fix brettwooldridgeGH-2171
It should be covered by #2133. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
We have an issue with spurious messages where the server gets shut down while some test code is still running. Our test cases work fine, but this creates messages like this:
WARN com.zaxxer.hikari.pool.ProxyConnection - jdbi-template-pool (*.*) - Connection oracle.jdbc.driver.T4CConnection@4886b6bd marked as broken because of SQLSTATE(08006), ErrorCode(18730)
I know it is broken, because we just shut down the server. To suppress those messages (QE keeps pestering us about "exceptions in test cases"), I am using a simple SQLExceptionOverride implementation that, in case we are in the process of shutting down, reject eviction (which suppresses that message).
However, because I can only pass in the class name into the config, I need to use a class level field to set that state. I'd like to use an instance level field (because I might use multiple connection pools). Right now, I am using this:
and call
ExceptionOverrider.CLOSED = true
to change state.but I want to use this:
which would allow me to use multiple, independent overrider instances.
However, I can neither pass my instance into the config (It only takes a string with the class name) nor can I retrieve the instantiated object from the pool base (It is package private and there is no setter).
Is it possible to make that instance accessible (make that field public final similar to the config)?
The text was updated successfully, but these errors were encountered: