|
From: James C. <jim...@do...> - 2004-07-29 19:46:25
|
Can you guys elaborate on this deferred close mode a bit more? Did I = miss an earlier posting? We have done a ton of experimenting with Open Session In View and = dropped it in favor of a service layer pattern. There are a bunch of tradeoffs to either approach and I am interested in learning about a potential third approach. > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] On = Behalf > Of Colin Sampaleanu > Sent: Thursday, July 29, 2004 1:59 PM > To: spr...@li... > Subject: Re: [Springframework-developer] New deferred close mode for > OpenSessionInViewFilter/Interceptor >=20 > I think this is cool and potentially pretty useful, in terms of > simplifying lazy relation handling. Now somebody using Open Session in > View now can not automatically swap out to this variant though, since = if > they are depending on sharing the same objects between different > invocations down to transactional services, they are going to get > exceptions from Hibernate when it sees that the objects are from > different sessions. On the other hand, this is great for somebody that > does want to call down once to a use-case defined service which = retturns > a graph of data, and now doesn't have to worry about touching all lazy > relationships that might be needed. This actually brings the Hibernate > scenario closer in line to what you can do with JDO 2 and handling of > non-transactional graphs. >=20 > Colin >=20 > j=FCrgen h=F6ller [werk3AT] wrote: >=20 > >Colin, > > > >As I was just discussing the issue with a colleague of mine, and as > you're known to not like the Open Session in View pattern ;-) > > > >What do you think regarding this "deferred close" mode for > OpenSessionInViewFilter/Interceptor that I've introduced a while ago? = That > combination of correct transactional semantics plus lazy loading in = the > view is a quite nice way to avoid the drawbacks of the classic > OpenSessionInViewFilter (what's now called "single session" mode). It > should never cause side effects but still allow for flexible lazy = loading. > > > >Juergen > > > > > >-----Original Message----- > >From: spr...@li... > >[mailto:spr...@li...]On = Behalf > >Of j=FCrgen h=F6ller [werk3AT] > >Sent: Friday, July 09, 2004 7:39 PM > >To: spr...@li... > >Subject: [Springframework-developer] New deferred close mode for > >OpenSessionInViewFilter/Interceptor > > > > > >Due to numerous recent requests in that direction, I've implemented a = new > mode for OpenSessionInViewFilter/Interceptor, as alternative to a = single > session per request: > > > >Each data access operation respectively transactions uses its own > Hibernate Session (like when not using Open Session in View). Each of > those sessions will be registered for deferred close, though, actually > processed at request completion. This does allow for lazy loading with > each of those sessions, but you won't get a single first-level cache = for > the entire request, as there can be multiple Sessions. > > > >OpenSessionInViewFilter/Interceptor still uses a single session per > request by default, but allows to activate deferred close mode instead = by > specifying "singleSession"=3D"false" as init-param respectively bean > property. > > > >Juergen > > > > >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by OSTG. Have you noticed the changes = on > Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, > one more big change to announce. We are now OSTG- Open Source = Technology > Group. Come see the changes on the new OSTG site. www.ostg.com > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |