hi guys,
when using Tapestry, what is the best way keep a hibernate session open for a complete request cycle to allow for lazy loading with HibernateDaoSupport - is the OpenSessionInViewInterceptor the way to go?
eg, after a call to say getHibernateTemplate.find() to get an object with a lazily loaded contained collection, a subsequent attempt to access the contained collection will normally cause a net.sf.hibernate.LazyInitializationException.
the tapestry BaseEngine class already has setupForRequest and cleanupAfterRequest methods that intercept the beginning and end of a request cycle.
an example configuration would be much appreciated as there do not seem to be many example of how to configure the OpenSessionInViewInterceptor.
many thanks,
regards,
greg johnson


Reply With Quote