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

For Hibernate Reactive enableCollectionInDefaultFetchGroup must be set to true #15814

Closed
DavideD opened this issue Mar 17, 2021 · 2 comments · Fixed by #15818
Closed

For Hibernate Reactive enableCollectionInDefaultFetchGroup must be set to true #15814

DavideD opened this issue Mar 17, 2021 · 2 comments · Fixed by #15818
Assignees
Milestone

Comments

@DavideD
Copy link
Contributor

DavideD commented Mar 17, 2021

Currently, the Hibernate Reactive extension doesn't set the property and so enableCollectionInDefaultFetchGroup is set to false. This is the default value for ORM.

The result is that when we try to fetch lazy collection we have a LazyInitializationException errors.
See this issue on Hibernate Reactive for more details: hibernate/hibernate-reactive#663

Example of code causing the exception:

    @GET
    @Path("/findBooks/{authorId}")
    public Uni<Collection<Book>> reactiveFindBooks(@PathParam("authorId") Integer authorId) {
        return mutinySession.find(Author.class, authorId)
                .chain(author -> mutinySession.fetch(author.getBooks()));
    }
@DavideD DavideD added the kind/bug Something isn't working label Mar 17, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 17, 2021

/cc @Sanne, @gavinking

@DavideD
Copy link
Contributor Author

DavideD commented Mar 17, 2021

I already have a fix

DavideD added a commit to DavideD/quarkus that referenced this issue Mar 17, 2021
The default for ORM is false, but when we create the SessionFactory
for Hibernate Reactive this value has to be true.

For more details, see:
hibernate/hibernate-reactive#663
DavideD added a commit to DavideD/quarkus that referenced this issue Mar 17, 2021
DavideD added a commit to DavideD/quarkus that referenced this issue Mar 17, 2021
DavideD added a commit to DavideD/quarkus that referenced this issue Mar 17, 2021
DavideD added a commit to DavideD/quarkus that referenced this issue Mar 17, 2021
DavideD added a commit to DavideD/quarkus that referenced this issue Mar 17, 2021
@quarkus-bot quarkus-bot bot added this to the 1.14 - main milestone Mar 17, 2021
@gsmet gsmet modified the milestones: 1.14 - main, 1.13.0.Final Mar 23, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Mar 23, 2021
The default for ORM is false, but when we create the SessionFactory
for Hibernate Reactive this value has to be true.

For more details, see:
hibernate/hibernate-reactive#663

(cherry picked from commit 76072c5)
gsmet pushed a commit to gsmet/quarkus that referenced this issue Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants