-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: hibernate second level cache and lazy initialized collection
PostPosted: Wed Apr 14, 2010 6:54 am 
Newbie

Joined: Tue Sep 25, 2007 6:30 am
Posts: 10
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 ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.