File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes fetch mode discussion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "fetch mode discussion" Watch "fetch mode discussion" New topic

fetch mode discussion

Wendy Gibbons

Joined: Oct 21, 2008
Posts: 1107

is there anywhere on the web i can find a good discussion on when to do lazy and when to do eager fetching please?
or could we have one here...
I the application i have inherited has all fetch.eager, and it keeps running out of memory, i feel this may be why
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Almost certainly!

The Hibernate docs discuss the basics, and there has been a lot of discussion in this forum so its worth a search here.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
James Sutherland
Ranch Hand

Joined: Oct 01, 2007
Posts: 553
Some info here:


I would recommend always using LAZY on all relationships.

TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
I agree. Here's the link:
subject: fetch mode discussion
jQuery in Action, 3rd edition