-
Notifications
You must be signed in to change notification settings - Fork 41.7k
Disable validate connection on borrow for Oracle UCP datasource #37501
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
Disable validate connection on borrow for Oracle UCP datasource #37501
Conversation
Can you explain a bit more why the default value should be |
|
The default value has always been false in UCP, this is a feature that should be explicitly set by the user. UCP Doc: "setValidateConnectionOnBorrow(boolean): Specifies whether or not connections are validated when the connection is borrowed from the connection pool. The method enables validation for every connection that is borrowed from the pool. A value of false means no validation is performed. The default value is false." The behaviour of UCP with Spring boot changes based on this property. When using a standalone ucp datasource, the default value is false and it should be the same when configured though spring boot properties as well. |
|
Assuming that I have read the diff correctly, @snicoll added the |
|
Ahem, I am afraid I do not. This looks strange. |
|
I agree that, by default, we should not turn on connection validation. It makes UCP do a roundtrip to the DB at every connection checkout which negatively impacts performance. |
My guess is that @snicoll did this because all the other datasources do this by default, see the tests in |
|
Thank you very much and congratulations on your first contribution 🎉! |
Removed setValidateConnectionOnBorrow method call while creating UCP datasource. This value should be false by default and can be overridden through datasource properties.