Skip to content
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

Allow TransactionAwareDataSourceProxy to eagerly fetch the connection #29423

Closed
wants to merge 1 commit into from

Conversation

reda-alaoui
Copy link

@reda-alaoui reda-alaoui commented Nov 2, 2022

Fix #29418

Adds an obtainTransactionalConnectionEagerly flag allowing to retrieve the underlying connection during getConnection call. I think this flag should be always true to make sure the effective connection is fetched during the transaction covering getConnection. But I thought you would want to avoid breaking the current behaviour, so the flag is false by default.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 2, 2022
@rstoyanchev rstoyanchev added the in: data Issues in data modules (jdbc, orm, oxm, tx) label Jan 24, 2023
@reda-alaoui
Copy link
Author

Ping?

@reda-alaoui
Copy link
Author

👋

@jhoeller
Copy link
Contributor

This would be a way to enforce consistent behavior for TransactionAwareDataSourceProxy next to other transaction-aware resource proxies. I'm inclined to implement this via a lazyTransactionalConnections flag which is true by default but can be turned to false, which seems like a better semantic fit next to reobtainTransactionalConnections (since asking for lazy+reobtain is semantically ok, saying lazy=false but reobtain=true is not effective but has no semantic conflict either, whereas saying eager=true + reobtain=true would be semantically odd).

@jhoeller jhoeller self-assigned this Nov 23, 2023
@jhoeller jhoeller added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 23, 2023
@jhoeller jhoeller added this to the 6.1.2 milestone Nov 23, 2023
@jhoeller jhoeller closed this in 47fe61e Dec 4, 2023
@reda-alaoui
Copy link
Author

reda-alaoui commented Dec 5, 2023

Thank you @jhoeller 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Projects
None yet
4 participants