This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Hibernate having the caching mechanism; we can get some performance improvement after caching the SQLs.
Also we have to define strategies for fetching data from the database based on the requirement either lazy or eager
The EAGER strategy is a requirement on the persistence provider runtime that data must be eagerly fetched.
The LAZY strategy is a hint to the persistence provider runtime that data should be fetched lazily when it is first accessed.
We have to avoid more reference tables when we designing the Data Model for hibernate.
Joined: Jul 07, 2012
thanks.I had read this in the section of advantages and disadvantages of Hibernate.
Hibernate certainly introduces a non-negligible overhead, for example it tends to cause lots of small queries retrieving IDs to be run against the DB. For an app with 10 users that may not matter; with 1000 users, that may kill the DB. I would think that most ORM systems suffer from similar issues, and should thus be used with care. The SQL they generate ORMs is just not well optimized.
I agree that one must carefully evaluate where (and whether) it makes sense to use built-in caches of the ORM vs. putting in place caches in the application code.