lessons to innovate & inspire!

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…

Keep on Reading

Class Cast Exception is a Proxy Problem – Revisited using the Visitor Pattern

In my previous post: ClassCastException is a Proxy Problem I talked about how Hibernate tries to optimize the loading of objects by lazily fetching the parent class object, and returning a proxy for the subclass instead of the actual subclass, thus causing a ClassCastException when the proxy is cast to the actual subclass.  The proxied object doesn’t contain member…

Keep on Reading