From: Christoph S. <ch...@mc...> - 2002-08-27 08:49:29
|
Hi Brad! This subject is an interesting one that I was also thinking of lately. I did a test app with maverick (mav.sourceforge.net), and there it was really easy. If the controller(=model) implements ModelLifetime, a discard function is called when the views are finished and the model is discarded. There I closed my session. Other frameworks that just forward to the view dont offer this functionality. For most of my stuff I use webwork, so I'd like a solution that works there too. I was thinking of closing the session in the finalize method of my controller, but then I dont really know when the session will be closed. Another possibility would be to to pass the session to velocity, and close it in the velocity view servlet after all is rendered. How did you implement it? regards chris ----- Original Message ----- From: "Brad Clow" <bra...@wo...> To: <hib...@li...> Sent: Tuesday, August 27, 2002 12:38 AM Subject: [Hibernate-devel] mvc & lazy loading > > to date, we have avoided using lazy loading when writing a web app in > one of the standard mvc type frameworks (eg. struts, webwork, etc). > this is because objects r typically retrieved, placed in the request > attributes, session closed and control is then passed to the view (JSP, > velocity, etc). if the view attempts to access a lazy loaded collection > in one of the objects an exception is thrown as the associated session > is closed. > > what do other people do? > > yesterday, i spent a few hours writing a very simple webapp framework > that uses velocity for the view. it enables the velocity rendering to > be done while a session is open. so far this is working quite well for > us. > > comments? > > brad > > > _______________________________ > > brad clow > > chief technical officer > > workingmouse > > > > email: bra...@wo... > > web: http://www.workingmouse.com > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r____________________________________________ ___ > Hibernate-devel mailing list > Hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > |