• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Best practices in using Hibernate

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Cameron

Kindly share some of the best practices while using Hibernate. Does your book share some tips on them?

Thank you.
[ June 02, 2008: Message edited by: Swami nathan ]
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the biggest best practice is really understanding how Hibernate works, and not just 'how to do things with Hibernate.'

My book certainly discusses practices such as Open Session in Viewand how to efficiently cache the the SessionFactory object in a singleton. I discuss how to build DAO objects that have Hibernate as the persistence mechanism, and the book also demonstrates how to leverage the J2EE service pattern, but all in all, I always belive that the most fundamental best practice is understanding how Hibernate works.

When people don't really understand what's going on with Hibernate, you often see people making too many unneeded calls to save, or performing flushes or refreshes when they aren't necessary. These types of extremely common mistakes aren't really a product of not using a best practice, as much as a fundamental lack of understanding about how Hibernate works.

I do believe that this is one of the most important contributions my new Hibernate book brings to the market. Using very simple and easy to understand Hiberante tutorials, you not only learn how to use Hiberante, but you learn how it works. And having this very fundamental understanding will eliminate all of those pesky NonUniqueObjectExceptions and LazyInitializationExceptions that are the bane of Hibernate programmers. Furthermore, when those types of problems do arise, when you really understand Hibernate, you'll know how to fix them!

Kindest regards,

-Cameron McKenzie
 
There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic