Skip to content

limit queries of single finders to 2 #2594

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

Closed
tschniewind opened this issue Jul 14, 2022 · 4 comments
Closed

limit queries of single finders to 2 #2594

tschniewind opened this issue Jul 14, 2022 · 4 comments
Assignees
Labels
type: enhancement A general enhancement

Comments

@tschniewind
Copy link

Enhancement:
Given a repositorys find-method returning a single result or an java.util.Optional should limit the underlying query to 2.

This would help to get the expected Result in case of multiple rows (IncorrectResultSizeDataAccessException) even if the query leads to huge result set.

(We had a case leading to an out of memory exception cause the query found about 50000 rows. Unfortunately we could not use a UniqueConstraint.)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 14, 2022
@gregturn gregturn self-assigned this Jul 18, 2022
@gregturn gregturn added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 18, 2022
quaff added a commit to quaff/spring-data-jpa that referenced this issue Jul 26, 2022
@schauder schauder assigned schauder and unassigned gregturn Jul 28, 2022
@tschniewind
Copy link
Author

In which version will this enhancement be integrated, any idea?

@schauder
Copy link
Contributor

This will be part of the next 3.0 milestone and therefore eventually in 3.0 GA.

gregturn pushed a commit that referenced this issue Dec 5, 2022
@gregturn
Copy link
Contributor

gregturn commented Dec 5, 2022

Backported to 2.7.x

gregturn pushed a commit that referenced this issue Dec 5, 2022
@gregturn
Copy link
Contributor

gregturn commented Dec 5, 2022

Backported to 2.6.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants