On Tue, May 22, 2012 at 3:59 PM, bhorvat <horvat.z.bo...@gmail.com> wrote:
> The thing is I am not sure for what it is used in the first place. Based on > everything that I have read it it seams to me that you use it to keep the > session open until you are done with the rendering of the tml. Yes. The hibernate session (just a remainder). > Say that you > load an object and that object has a list of objects in it, and you try to > access the list in the tml page with say the loop component. Now if you > dont > use the OpenSessionInViewFilter you should get an exception > (LazyInitalization). Yes but only if the session is close. > However I dont get that exception, so I was wondering > (since most of the stuff for OSIVF is a bit old) is tapestry now handling > this itself (tapestry-hibernate that is) or am I miss understanding what > the > filter is used for in the first place? > No. > > I would like to solve 2 problems with this transaction. The first one is > the > LazyInitalization. I always have to reload the object in the methods that > handle the form if I need to use some list of objects that have not been > used when the page was rendered. > Yes . Why is that unusable for you? The LazyInitalization is caused because the entity is from another session (detached) and you are trying to access a lazy property. > > The second problem is that I want to put Transaction annotation or > something > like that so that I have transaction behavior instead of having every part > of (what should be single transaction) commit independently. > CommitAfter is a nice example. But CommitAfter doesn't support nested transactions. For this you'll need your own advice - or just don't call @CommitAfter annotated methods in a transaction (other @CommitAfter methods). > tnx for your help > > cheers > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/Tapestry-Transactions-tp5713299p5713314.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >