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

Panache Regression in 3.13: singleResultOptional throws wrong NonUniqueResultException #42416

Closed
Felk opened this issue Aug 8, 2024 · 5 comments · Fixed by #42423
Closed
Assignees
Labels
area/panache kind/bug Something isn't working
Milestone

Comments

@Felk
Copy link
Contributor

Felk commented Aug 8, 2024

Describe the bug

In Quarkus 3.13.0 and 3.13.1, calling singleResultOptional() now throws a org.hibernate.NonUniqueResultException if there are 2 or more results. It used to throw a jakarta.persistence.NonUniqueResultException in Quarkus 3.12 and earlier, and the documentation for 3.13 also still says it throws a jakarta.persistence.NonUniqueResultException.

I haven't checked whether other exceptions, e.g. jakarta.persistence.NoResultException are also affected.

Expected behavior

singleResultOptional() throws jakarta.persistence.NonUniqueResultException, like in Quarkus 3.12.x and before

Actual behavior

singleResultOptional() throws org.hibernate.NonUniqueResultException

@Felk Felk added the kind/bug Something isn't working label Aug 8, 2024
Copy link

quarkus-bot bot commented Aug 8, 2024

/cc @FroMage (panache), @loicmathieu (panache)

@gbourant
Copy link

gbourant commented Aug 8, 2024

Maybe this is caused because Panache no longer depends on EntityManager? #41518

@gsmet
Copy link
Member

gsmet commented Aug 8, 2024

Yeah I suspect that's the culprit. I'm not sure if this was foreseen and accepted or not.

It's definitely a breaking change though.

@yrodiere is on PTO and I think we really need to talk to him about this as it ends up being a rather radical change from a user POV.

@gsmet
Copy link
Member

gsmet commented Aug 8, 2024

My current recommendation is to not update your app. I will discuss this with @yrodiere and @marko-bekhta on Monday.

@quarkus-bot quarkus-bot bot added this to the 3.14 - main milestone Aug 9, 2024
@Felk Felk changed the title Panache Regression in 3.13: singleResult throws wrong NonUniqueResultException Panache Regression in 3.13: singleResultOptional throws wrong NonUniqueResultException Aug 9, 2024
@gsmet
Copy link
Member

gsmet commented Aug 9, 2024

I will announce it on Monday morning but I released 3.13.2 today with the fix.

@gsmet gsmet modified the milestones: 3.14.0.CR1, 3.13.2 Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/panache kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants