Skip to content

Conversation

@sreekarareddy
Copy link
Contributor

Removed setValidateConnectionOnBorrow method call while creating UCP datasource. This value should be false by default and can be overridden through datasource properties.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 20, 2023
@philwebb
Copy link
Member

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.

@philwebb philwebb added the status: waiting-for-feedback We need additional information before we can continue label Sep 20, 2023
@sreekarareddy
Copy link
Contributor Author

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.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Sep 21, 2023
@wilkinsona
Copy link
Member

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?

@wilkinsona wilkinsona added the for: team-attention An issue we'd like other members of the team to review label Sep 21, 2023
@snicoll
Copy link
Member

snicoll commented Sep 21, 2023

Ahem, I am afraid I do not. This looks strange.

@jeandelavarene
Copy link

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.

@philwebb philwebb added type: enhancement A general enhancement and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Sep 27, 2023
@philwebb philwebb added this to the 3.2.x milestone Sep 27, 2023
@mhalbritter mhalbritter changed the title Removed setValidateConnectionOnBorrow method call on ucp datasource Disable validate connection on borrow for UCP datasource Sep 28, 2023
@mhalbritter mhalbritter changed the title Disable validate connection on borrow for UCP datasource Disable validate connection on borrow for Oracle UCP datasource Sep 28, 2023
@mhalbritter mhalbritter self-assigned this Sep 28, 2023
@mhalbritter mhalbritter added the status: noteworthy A noteworthy issue to call out in the release notes label Sep 28, 2023
@mhalbritter
Copy link
Contributor

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.

@mhalbritter
Copy link
Contributor

Thank you very much and congratulations on your first contribution 🎉!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: noteworthy A noteworthy issue to call out in the release notes type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants