DWR with Hibernate

05
Feb
So I was testing out a huge portion of code involving DWR and hibernate and I encountered massive slowdowns. Log files generated massive amounts of LazyInitializationException errors. Turned out that DWR attempted to convert hibernate objects, invoking all the lazy-loaded child objects along the way. The solution? Specify the converter in WEB-INF/dwr.xml as "hibernate".

<convert converter="hibernate" match="com.mymodels.mybean" />

This will tell DWR to skip all lazy-loaded children for hibernate. Of course you'll have to explicitly join children you need but its way easier to manage, IMO.