> > -----Original Message----- >From: Bill Schneider [mailto:[EMAIL PROTECTED] >Sent: Tuesday, 20 September 2005 11:01 PM >To: user@struts.apache.org >Subject: Re: Being Lazy with Hibernate > >>>>>Has anyone been able to get a Struts / Hibernate app to work nicely with >>>>>Lazy Initialization? >>>>> >>>>Whenever I have things with Lazy set to true I'm getting a "Failed to lazily >>>>initialize a collection" Exception. > >The easiest way to do this is to use the "open session in view" pattern. > >If you're using Spring to manage your Hibernate SessionFactory, you can >just pop the OpenSessionInViewFilter in web.xml and go. The only thing >to watch out for is that any writes back to the database need to be >within transactions. > >-- Bill >-- >Bill Schneider >Chief Architect > >Vecna Technologies, Inc. >5004 Lehigh Road, Suite B >College Park, MD 20740 >[EMAIL PROTECTED] >t: 301-864-7594 >f: 301-699-3180
I am using Spring and have bee having a go at getting this pattern to work without much luck. Not sure what I am doing wrong but will persevere. It seems as though even if I have the filter in place I still get the Exceptions. Perhaps I need to disable some of my existing setup (on top of setting up the filter properly). Could I have a conflict somehow? Regards Marty --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]