The problem was the old/new session as Rich described.  Instead of rerunning the query I just reattached the objects to the new session with session.lock.

I opted for this because the table data comes from 1 of 2 queries depending on user interaction within the page.  Instead of trying to figure out what the user did to generate the table I just reattached the objects.  

Is the reattach with hibernate session.lock(obj, LockMode.NONE) expensive?  What does it do?





Werner Punz <[EMAIL PROTECTED]>
Sent by: news <[EMAIL PROTECTED]>

09/29/2005 12:37 PM

Please respond to
"MyFaces Discussion"

To
[email protected]
cc
Subject
Re: Hibernate and Datascroller





Ryan Wynn wrote:
>
> Any hibernate-spring experts out there that could tell me how I can
> still get a LazyInit exception inside my spring OpenSessionInViewFilter.
>  My stack trace clearly says I am inside the Filter.  Exception - No
> session or session was closed.
>
> This is happening when using the myfaces datascroller for a datatable
> and paging.  Bean that holds List of data for table is session scoped.
>
> Unfortunately, the data is a list of hibernate objects.  I probably
> should be copying these into plain pojos for the view, but that is not
> what I am doing.  Probably because then I could need to replicate my
> entire object tree.
Probably a recycled data model?
Another option, which I had once in a project... either the filter
is not correctly set, or you might have an iframe somewhere triggering
something hibernatish outside of your filter.

Werner



Reply via email to