Hi all
Here's my problem.
I'm working with a 2nd level cache (EhCache) on a web application with an openSessionInView Spring filter.
Everything worked fine so far until i activated the 2nd level cache (new feature).
But now i see in the logs of my application that i have some LazyInitializationException :
Code:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.network.model.MyEntity.activities, no session or session was closed
I'm wondering if this could be linked to a MyEntity loaded in another place without its activities initialized, and afterwards loaded in the offending jsp, in which we explicitly call the MyEntity.getActivities(). The MyEntity being taken from the cache, it's not in a session so cannot access the database to load its activites using the osiv filter.
Would it seem a correct explanation of my problem?
And if so, would you have a solution for this?
Thx a lot for your time ;)