jump to navigation

BlazeDS Hibernate Lazy loading problem solved October 8, 2010

Posted by maxmil in : BlazeDS,Java , trackback

I finally got around to working on a solution to the lazy loading problem that exists when using hibernate with BlazeDS.

I think that the solution is a pretty clean one. It consists in an annotation that you put on methods returning results to BlazeDS.

The annotation configures what part of the object graph is excluded from serialization.

I was going to use dpHibernate or Gilead but didn’t really need all the advanced features of initializing associations from flex.

This solution is a light and easy one.

The code and a jar are available on GitHub


1. Fabio Barbon - August 1, 2011

hi maxmil,

thanks for your light and elegant contribution to the “blazeds vs lazy loading” problem.

just a trivial question: why fetchEager annotation property is true by default?

thanks again, ciao

2. maxmil - August 1, 2011

Whilst setting fetchEager to false is a very easy solution it is kind of dangerous since seemingly unrelated changes to your server side code can affect which entities needed to be fetched lazily or not which can break your flex application.

For this reason i thought think that it is better that the developer should consciously activate this option.