OpenSessionInViewFilter has nothing to do with detached entities, it only keeps 
session open till view is rendered otherwise lazy loading will no work. The 
filter is trying to solve it by always opening session in every request and 
closing it at the end. Tapestry hibernate opens session only when it is needed 
and closes it when thread is finished, it is how it should be, but if you use 
spring hibernate + tx you need to use it there is no way around it.

Denis

May 22, 2012 v 3:59 PM, bhorvat:

> 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. 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). 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?
> 
> 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. 
> 
> 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.
> 
> 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
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to