Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Brooklyn Smith   on Apr 18 In Java Category.

  
Question Answered By: Lee Butler   on Apr 18

Most Hibernate performance problems  are human errors. Take lazy loading as an example. In Hibernate2 it defaulted to false, in 3 it defaults to true. None of these are good  defaults imho. You have to adjust them "case by case". Now most people never touch these lazy loading settings! Consider a big page, say a page showing Company information, with a grid in it showing Employees of that company (which let's say has 15,000 employees). In Hibernate2 this page would load both company and all it's 15,000 employees. Clearly a performance disaster! In Hibernate 3 it would load perhaps 10 employees (considering grid shows 10 employees in each page with next/previous buttons), a much better result. But still, the correct way to do it is an hql query, with considering the caching in writing it. Caching of course is one of my favorite Hibernate issues. Most people never touch its settings!! You can't expect it to perform well with the silly defaults. You have to set it case by case, based on the requirements of the application. I can assure you, in most cases, with correct use of Hibernate you can come up a system performing way better than one based on lots of pedal-to-the-metal hand-tuned-to-hell SQL queries!

Share: 

 

This Question has 23 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Hibernate vs JPA Or get search suggestion and latest updates.


Tagged: