Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6806965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:46:29+00:00 2026-05-26T19:46:29+00:00

I went through the Hibernate Tutorial at http://docs.jboss.org/hibernate/core/3.3/reference/en/html/performance.html and got the question which fetch

  • 0

I went through the Hibernate Tutorial at http://docs.jboss.org/hibernate/core/3.3/reference/en/html/performance.html and got the question which fetch strategy among select or Join is better and we should go for. I know most of the guys will say it depends upon your requirement.But in most of the web applications we have common requirements i.e performance should be good. Here is my understanding :-

Lazy/Select Fetch strategy:- Select Fetch strategy is the lazy fetching of associations. The purpose of Lazy strategy is memory optimization . When I say memory optimization it means it means it saves us from heap error. This is what I think. So we can say yes if we are loading too objects in aseesion we should go for
Lazy Fetch strategy but in terms of time performance it does not provide any Benefit. Agreed?

Eager/Join Fetch strategy:- Join Fetch strategy the eager fetching of associations.The purpose of Join Fetch strategy is optimization in terms of time.I mean even associations are fetched right at the time of fetching parent object. So in this case we don’t make database call again and again . So this will be much faster.Agreed that this will bad if we are fetching too many objects in a session because we can get java heap error.

So now can we say in the hibernate session where we are not loading too many objects we should go for Eager fetch as it will be much better in terms of time response(Any ways memory will be reclaimed by garbage collector once we close the session)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:46:29+00:00Added an answer on May 26, 2026 at 7:46 pm

    Go for Join if you need the data to be loaded and Select if you usually don’t need it.

    About the Java Heap Error do not worry too much. You must be loading tons of objects. You can set up the batch size. The load of the object is not the only strategy.

    If you do not need to load all objects you can add specific HQL or Criterias.

    If you need more than you don’t the object go for Join otherwise Select.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I went through this tutorial (http://www.adobe.com/devnet/facebook/articles/flex_fbgraph_pt4.html) and got everything working, only to find out
I went through http://platform.netbeans.org/tutorials/nbm-quick-start.html#lookup , but when I define the dependencies, it doesn't get
I went through the documentation( http://java.sun.com/javase/6/docs/api/java/util/Iterator.html ) of Iterator.remove() there remove( ) was described
I went through the documentation in http://www.opengroup.org/onlinepubs/009695399/functions/pthread_cond_wait.html but this is not mentioned explicitly. Any
I went through a document at Adobe Livedocs that describes working with pdf: http://livedocs.adobe.com/flex/3/html/help.html?content=PDF_1.html
went through the tutorial http://www.sohtanaka.com/web-design/facebook-style-footer-admin-panel-part-1/ and tried the same to make a fixed top
I just went through a spring transaction tutorial which mentions that there are some
So just went through this tutorial: http://icodeblog.com/2010/04/05/ipad-programming-tutorial-hello-world/ Now what I want to do is
I went through these instructions: http://docs.amazonwebservices.com/AmazonRDS/latest/GettingStartedGuide/ But still can't connect to the database using
I went through some tutorials on the State monad and I think I got

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.