Strange Hibernate session issue causing LazyInitializationException when entering webflow
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.
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?