Removed setValidateConnectionOnBorrow method call while creating UCP datasource. This value should be false by default and can be overridden through datasource properties.
Comment From: philwebb
This value should be false by default and can be overridden through datasource properties
Can you explain a bit more why the default value should be false? I'm concerned that if we change the default we will break back-compatibilty.
Comment From: sreekarareddy
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."
link: https://docs.oracle.com/en/database/oracle/oracle-database/21/jjucp/validating-ucp-connections.html#GUID-211C9AFC-6ABA-4FEB-B10C-B0E2BEB526FD
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.
Comment From: wilkinsona
Assuming that I have read the diff correctly, @snicoll added the setValidateConnectionOnBorrow(true) call as part of polishing the Oracle UCP contribution. Stephane, can you remember the reasoning behind that change?
Comment From: snicoll
Ahem, I am afraid I do not. This looks strange.
Comment From: jeandelavarene
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.
Comment From: mhalbritter
Ahem, I am afraid I do not. This looks strange.
My guess is that @snicoll did this because all the other datasources do this by default, see the tests in DataSourceAutoConfigurationTests.
Comment From: mhalbritter
Thank you very much and congratulations on your first contribution :tada:!