Strange Hibernate session issue causing LazyInitializationException when entering webflow

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Strange Hibernate session issue causing LazyInitializationException when entering webflow

jondo_w
Hi all,

In our application we use second level caching (with ehcache) for some GORM objects that are referred to very frequently to determine authentication/authorization permissions. This all works fine, and there are no problems with LazyInitializationException's whatsoever. However, the moment I click on a link that enters a webflow, we get the LazyInitializationException's on relationships amongst the auth GORM objects that otherwise work fine.

In the DEBUG logging I see the following lines:

2011-03-29 18:46:16,309 DEBUG - sessionStarting: Binding Hibernate session to flow
2011-03-29 18:46:16,342 DEBUG - paused: Disconnecting Hibernate session

When I set a breakpoint at the line of code that is the first line to cause the LazyInitializationException's, I notice that the responsible object's isAttached() method returns false, whereas prior to entering the webflow, the same call returns true. So it does appear to be linked to the current Hibernate session somehow. The webflow uses a service that is scoped for "conversation". These are all the facts that I note that seem relevant.

Does anybody who is more familiar with webflows know what would cause the above lines to be logged, and why the webflow session would be somehow 'disconnected' from the second level cache?

Many thanks,
Darryl Pentz