-->
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.  [ 2 posts ] 
Author Message
 Post subject: Lazy collection in lazy collection
PostPosted: Fri Jul 23, 2004 8:31 am 
Regular
Regular

Joined: Thu Aug 28, 2003 6:30 am
Posts: 58
Hi alls. I've got a problem:
A -- lazy collection of --> B
B -- lazy collection of --> C

When A contains some B objects in collection then i can't retrieve lazy objects C from B.
But when there's null collection of B in A object and i do such thing
a.setBes(new ArrayList())
a.getBes().add(b)
session.update(a);
session.commit();
i can't retrieve c from b - a.getBes().get(0).getCes() .
I've got LazyInitializationException with message "Failed to lazily initialize a collection - no session or session was closed".

What am i doing wrong?

hibernate 2.1.3 or checked out from cvs - 2.1.5


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 23, 2004 8:50 am 
Regular
Regular

Joined: Tue Oct 28, 2003 8:25 am
Posts: 72
Location: Belgium
It means that the session you used have been closed meanwhile.

Either use eager fetching or reattach your entities to another session.


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

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.