i'm using ejb3/hibernate, and the important part is not really the transaction but the entitymanager-context (i.e. the hibernate session) wich is somehow bound to the transaction.
The problem here is the handling of lazy loaded collections. If i don't eager-load (either by declaring them as eager or by explicitly referencing while a have a transaction, e.g. from within a sessionbean) the collections that may be referenced from a model during rendering, hibernate will throw a "LazyInitializationException" in case there is no active Transaction/Hibernate-session. Marco Igor Vaynberg wrote: > why not only open a transaction when a connection is asked for? > > what persistence layer are you using? > > -Igor > > > On 4/23/06, Marco Geier <[EMAIL PROTECTED]> wrote: > >>I'd like to wrap all the event-handling and renderig stuff with a >>transaction. >>So one approach would be to define a (Servlet)Filter or modify some >>requestcycle settings. But when i use REDIRECT_TO_BUFFER i just want to >>wrap the first request (i.e. the processing and rendering part), but not >>the second request that just returns the buffer and therefore abviously >>doesn't need a transaction. >> >>From just looking at the requested URL i can't really distinguish these >>request, i.e.: >> >>first (clicked) request:http://127.0.0.1/app?wicket:interface=:4:2:: >>redirect request: http://127.0.0.1/app?wicket:interface=:4:4:: >> >>Is there any hook or something within requestcycle to use for such a >>behaviour? >>(if not, imho, this would be a really usefull addition to the wicket >>API, especially for people using wicket together with hibernate) >> >>Rgds, >> >>Marco >> >> >>Dipl.-Ing. Marco Geier >>EyeTea GmbH >>Germany >>phone +49 (0)721 662464-0 >>fax +49 (0)721 662464-1 >>mobile +49 (0)177 6579590 >>[EMAIL PROTECTED] >> >> >>------------------------------------------------------- >>Using Tomcat but need to do more? Need to support web services, security? >>Get stuff done quickly with pre-integrated technology to make your job >>easier >>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >>_______________________________________________ >>Wicket-user mailing list >>[email protected] >>https://lists.sourceforge.net/lists/listinfo/wicket-user >> > > -- ___________________________ Dipl.-Ing. Marco Geier EyeTea GmbH Germany phone +49 (0)721 662464-0 fax +49 (0)721 662464-1 mobile +49 (0)177 6579590 [EMAIL PROTECTED] ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
