-->
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.  [ 5 posts ] 
Author Message
 Post subject: session.evict causes lazy collection to be loaded
PostPosted: Thu Dec 18, 2003 7:43 pm 
Beginner
Beginner

Joined: Wed Sep 17, 2003 4:07 pm
Posts: 22
Here is my problem:

I did a load of an object that has 2 lazy collections. I have not accessed those collections after the object is loaded so I didn't see any Select statements for those lazy collections. Now when I do a session.evict of that loaded object, I see 2 select statements for those lazy collections. When I am evicting an object, why should the lazy collections be loaded?

Thanks


Top
 Profile  
 
 Post subject: session.evict causes lazy collection to be loaded
PostPosted: Fri Dec 19, 2003 2:01 pm 
Beginner
Beginner

Joined: Wed Sep 17, 2003 4:07 pm
Posts: 22
Trying to get the attention again...

Can someone respond, please?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 19, 2003 2:05 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
http://forum.hibernate.org/viewtopic.php?t=541&highlight=evict+cascade

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 19, 2003 2:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Actually, evict never cascades to uninitialized collections. Anyway, I checked the code, and I'm quite certain that Hibernate is not reponsible for initializing the collections.

Use your debugger to find where your code accesses the collections (eg. get/set pairs, toString() methods, etc).

If you still believe it is Hibernate responsible (ie. if by debugging into the Hibernate source, you found that the cause if Hibernate), prove it by giving a working test case.


Top
 Profile  
 
 Post subject: session.evict causes lazy collection to be loaded
PostPosted: Fri Dec 19, 2003 5:01 pm 
Beginner
Beginner

Joined: Wed Sep 17, 2003 4:07 pm
Posts: 22
Gavin,

You are absolutely right. One of my get methods was accessing the set size. Thank you for your response. I really appreciate your confidence.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.