Hi I have declared several of my collections and associations to be loaded lazily (for performance). However, this does seem to give rise to a load of code in my service layer where I have to explicitly load a collection (using Hibernate.initialize) and then loop over the returned collection, and explicitly load other collections/proxies etc etc. The only other option would appear to be to use the Open Session In View layer and keep the transaction open across the HTTP request. Or maybe to use an HQL query but I think I would still be setting some kind of eager fetch criteria for various objects explicitly so I dont think this helps. Is there any other solution? What are people's views? thanks, Baljeet.
|