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

Restrict eager loading to @OneToOne and @OneToMany relationships #39

Merged
merged 1 commit into from
Nov 19, 2016

Conversation

darrachequesne
Copy link
Owner

@darrachequesne darrachequesne commented Nov 19, 2016

Previously, a JOIN FETCH was also added when dealing with a
relationship that may return multiple lines (@OneToMany, for example).
Since Hibernate doesn't know how many lines it will need to construct
your entities, it fetches a lot of lines and store them in memory,
resulting in a big performance hit. In that case, the following warning
is displayed: "HHH000104: firstResult/maxResults specified with
collection fetch; applying in memory!". That commit thus restricts JOIN
FETCH to @OnetoOne and @manytoone relationships.

Fixes #38

Previously, a JOIN FETCH was also added when dealing with a
relationship that may return multiple lines (@OneToMany, for example).
Since Hibernate doesn't know how many lines it will need to construct
your entities, it fetches a lot of lines and store them in memory,
resulting in a big performance hit. In that case, the following warning
is dislayed: "HHH000104: firstResult/maxResults specified with
collection fetch; applying in memory!". That commit thus restricts JOIN
FETCH to @OnetoOne and @manytoone relationships.
@darrachequesne darrachequesne merged commit abeda66 into master Nov 19, 2016
@darrachequesne darrachequesne deleted the proper-fetch branch November 19, 2016 22:30
@darrachequesne darrachequesne added this to the 3.0 milestone Nov 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant