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

SQL supplier in R2DBC DatabaseClient is eagerly invoked #29887

Closed
github-actions bot opened this issue Jan 26, 2023 · 1 comment
Closed

SQL supplier in R2DBC DatabaseClient is eagerly invoked #29887

github-actions bot opened this issue Jan 26, 2023 · 1 comment
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: backport An issue that is a backport of another issue to a maintenance branch type: enhancement A general enhancement
Milestone

Comments

@github-actions
Copy link

Backport of gh-29367

@github-actions github-actions bot added in: data Issues in data modules (jdbc, orm, oxm, tx) type: backport An issue that is a backport of another issue to a maintenance branch type: documentation A documentation task type: enhancement A general enhancement labels Jan 26, 2023
@github-actions github-actions bot added this to the 5.3.26 milestone Jan 26, 2023
simonbasle added a commit that referenced this issue Jan 26, 2023
This commit modifies the `DefaultDatabaseClient` implementation in order
to ensure lazier usage of the `Supplier<String>` passed to the sql
method (`DatabaseClient#sql(Supplier)`).

Since technically `DatabaseClient` is an interface that could have 3rd
party implementations, the lazyness expectation is only hinted at in the
`DatabaseClient#sql` javadoc.

Possible caveat: some log statements attempt to reflect the now lazily
resolved SQL string. Similarly, some exceptions can capture the SQL that
caused the issue if known. We expect that these always occur after the
execution of the statement has been attempted (see `ResultFunction`).
At this point the SQL string will be accessible and logs and exceptions
should reflect it as before. Keep an eye out for such strings turning
into `null` after this change, which would indicate the opposite.

Backport of d72df5a
See gh-29367
Closes gh-29887
@simonbasle
Copy link
Contributor

Closed by de53d77

@jhoeller jhoeller removed the type: documentation A documentation task label Feb 1, 2023
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: backport An issue that is a backport of another issue to a maintenance branch type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants