-
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
Too pessimistic handling of SQLFeatureNotSupportedException for Postgres binary fields #1489
Comments
Created PR (#1509) to help address this generally. Regarding SQLFeatureNotSupportedException (sql state |
For what it's worth, until this is fixed (via #1509 or otherwise) we are working around this issue with the following:
|
@acehead @westse I have implemented this in a slightly different way than pull request #1509. This change keeps the configuration surface area to a minimum, as well as allowing purely text-based (e.g. property-based) configuration. You can see an example usage here and here. This will likely be released in several days along with several other fixes and after the completion of documentation. |
@brettwooldridge did you also see the feedback from this issue? #1388 (comment) |
I'm fine with this solution. Nevertheless I still think it is wrong in the majority of cases to consider SQLTimeoutException an eviction reason as implemented due to #1308. I think handling SQLTimeoutException is something for the application to handle. Maybe you should consider adding a default SQLExceptionOverride that returns DO_NOT_EVICT for SQLTimeoutException. |
Environment
Hikari closes connection on SQLFeatureNotSupportedException which leads to problems handling scenarios when exact driver implementation is not known so client code can execute potentially not implemented operations.
Specifically, this happens when using Hikari with Postgres as a connection pool for ActiveJDBC layer. ActiveJDBC tries to implement both Oracle and Postgres ways of storing binary data (https://github.com/javalite/javalite/blob/master/activejdbc/src/main/java/org/javalite/activejdbc/DB.java#L690) and handles SQLException itself. However subsequent use of the setObject() fails as the connection is already closed by Hikari.
This might seem to look like ActiveJDBC issue although I cannot propose any way for them to handle this situation in a driver-agnostic way. Hikari approach seems to be rather unexpected and was introduced in #1003
I haven't yet filed an issue for ActiveJDBC, it would be really appreciated if this would be fixed either in Hikari, or there could be a good way to implement it in client code like ActiveJDBC. I would like to avoid hackish solutions like putting custom HikariProxyConnection on the classpath.
The text was updated successfully, but these errors were encountered: