|
From: Daniel M. <mi...@pa...> - 2004-06-13 00:26:03
|
James, I don't know of any documents that summarize this behavior. There have been several discussions of this on the mailing lists though. I guess I should have elaborated on that part a bit more in my previous post. Keep in mind that a single session is opened at the beginning of the request, and that session is used by all data access methods throughout the request. Now if an DataAccessException occurs during the controller processing, normally the transaction would be rolled back and the session discarded immediately. Subsequent data access methods would not continue to use the session in which the exception occurred, they would create a new session. However, with the OpenSessionInView pattern the same session continues to be used for all data access methods including lazy loading during view rendering--the session is not closed until after the view is rendered. With the new implementation that I talked about, the controller logic can use and discard sessions as needed. A separate session is created for the view and any objects that need to use that session (e.g. for lazy loading) will be bound to it before the view is rendered. ~ Daniel -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of James Cook Sent: Saturday, June 12, 2004 4:43 PM To: spr...@li... Subject: RE: [Springframework-developer] Real OpenSessionInView (only in view) Daniel, Is there a document somewhere that summarizes this behavior in Hibernate? I'm trying to understand what the drawbacks to open session in view are. I don't understand the point you make about the session not being discarded [closed properly?]. > -----Original Message----- > Of Daniel Miller > > Hello, > > One of the current critiques of the OpenSessionInViewFilter/Interceptor > that > ships with Spring is that a Hibernate session is open for the entire > duration of the request (not just during the rendering of the view). The > danger here is that a failed session (due to DataAccessException) will not > be discarded. ------------------------------------------------------- This SF.Net email is sponsored by the new InstallShield X. >From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |