Femgineer

Hibernate Remote Lazy Loading to the Rescue

I’ve written a couple of posts recently on Lazy Loading, and some of the issues relating to how Hibernate creates and manages proxies.  While lazy loading itself is meant to improve performance, it can still lead to exceptions caused by objects being detached from their session.  As a web service becomes more distributed, and the number of requests increases the need for lazy loading remotely becomes more important, but implementing it without unintended consequences can be a little tricky.  Yesterday I was scanning through TheServerSide.COM and came across he following article on RemoteLazyLoadinginHibernate.  Its contains a good primer on lazy loading in Hibernate.  The more advanced concepts in the article deal with resolving exceptions caused by detached objects, helping to bridge the gap between performance and correctness.  This article has some good examples and methods of how to implement remote lazy loading, and Rajendran leaves us with the exercise of using it in conjunction with additional Hibernate features to improve site performance.

Enhanced by Zemanta

Exit mobile version