When using the OSIV-filter the lazyload exception may only happen if the same entity is used among different requests ... sothat it gets detached from hibernate. have a look at http://talk-on-tech.blogspot.com/2008/05/custom-reuseable-loadabledetachablemode.html ... that's the way we're doing it
regards, Michael Korbinian Bachl - privat wrote: > > >I think it could be something about > > missing usage of loadabledetachable model..? > > not for me, as the original entity is pulled using an > loadabledetachableModel via a SortedDataProvider :/ > > if you look around, the all called solution for this is the > "OpenSessionInViewFilter" and the usage of > <bean id="transactionManager" > class="org.springframework.orm.jpa.JpaTransactionManager"> > for that (latter one is used by me, too) > > However, the OpenSessionInViewFilter will not work with wicket, even if > mapped to "/*" in the web.xml > > Best, > > Korbinian > > > > > Nino Saturnino Martinez Vazquez Wael schrieb: >> Hi Korbinian >> >> Im facing the same problems... I also use extended.. So gonna be great >> to see the outcome of this thread.. I think it could be something about >> missing usage of loadabledetachable model..? >> >> >> >> >> >> Korbinian Bachl - privat wrote: >>> Hi, >>> >>> I'm currently struggling with the famous "lazy load exception" under >>> spring + jpa with wicket. >>> >>> The problem is, in my case, that i pull an entity from the database >>> using a spring-bean (@SpringBean) and JPA (hibernate). Then in the >>> wicket class i need to walk the entity tree a bit, based on the needs >>> of the user (preloading wont work, as i dont know the direction the >>> user wants to walk and the whole entity tree is too complex to grab it >>> all at once). >>> >>> If I use the Entity myEntity.getMyOtherConnectedEntity I get the lazy >>> load exception (transaction already closed). So I tried to use the >>> OpenSessionInViewFilter to solve this, but it just won't work - no >>> reason why, as the error stays exactly the same. >>> >>> Currently I ended up using this: >>> @PersistenceContext(type = PersistenceContextType.EXTENDED) >>> private EntityManager em; >>> >>> However, I'm not sure if this is the way it is supposed to be? >>> ( I read so far that this disables a big part of springs-transaction >>> handling support but didnt see any impacts so far) >>> >>> Has anyone a different aproach/ solution for this using wicket + >>> spring with JPA? >>> >>> Best, >>> >>> Korbinan >>> >>> PS: im on wicket 1.4-m3 >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > ----- Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/wicket-%2B-spring-%2B-jpa--hibernate-%3D-lazy-load-exception-tp19721199p19722521.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
