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: Pls help: "failed to lazily initialize a collection&quo
PostPosted: Tue Sep 05, 2006 4:26 am 
Beginner
Beginner

Joined: Mon May 22, 2006 12:12 am
Posts: 23
Dear All,


I was trying to tune my slow Using Nhibernate implementation, as such I've turned on "lazy=true" for some sets of a table like this in a class called folder:

<set name="docs"
lazy="true"
inverse="false"
cascade="all-delete-orphan" table="FolderDocuments">
</set>

After I've done this, I hit the following error : "failed to lazily initialize a collection" on running the code:

if (folder.docs.Count > 0)

...

I'm nothing from being proficient in NHibernate. Hope you experts can guide me thru.

thanks!
jl


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 06, 2006 4:41 am 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
how do you manage the session? usually this occurs when you access the collection declared as lazy while your session is closed. The ideea is to keep your session open while you manipulate your persistent objects. check this site for docs and posts regarding session management.

radu


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.