-->
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.  [ 3 posts ] 
Author Message
 Post subject: De-initialize a not-cascaded OneToMany List during merge
PostPosted: Thu Mar 20, 2008 5:45 am 
Regular
Regular

Joined: Thu Oct 13, 2005 4:19 am
Posts: 98
I have a detached A which has a not-cascaded List of B's that were eager fetched in the previous transaction.
Now when I try to merge this A, hibernate replaces all B's with a proxy but leaves the B List alone, which surprises me, since it's not cascaded.
I expected it to replace the B List with an uninitialized list, since it's not cascaded. Is there any way I can configure it so it does replaces the B list with an unitialized list during a merge of A?

_________________
http://www.ohloh.net/accounts/ge0ffrey


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 20, 2008 9:25 am 
Regular
Regular

Joined: Thu Oct 13, 2005 4:19 am
Posts: 98
After some debugging, it turns out it does replace the B list with an uninitialized list during the merge of A.

However, because the B List is intialized when starting the merge of A, it decides to load all B's with n + 1 queries from the database. Why?
It doesn't actually use those B's, although it does crash if one of those B's no longer exists (and I don't want it to crash on that). Is there any way I can turn off that useless loading?

Thanks for any help :)

_________________
http://www.ohloh.net/accounts/ge0ffrey


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 26, 2008 8:29 am 
Regular
Regular

Joined: Thu Oct 13, 2005 4:19 am
Posts: 98
I've created a testcase patch which clearly demonstrates the inconsistency:

http://opensource.atlassian.com/project ... se/EJB-347

_________________
http://www.ohloh.net/accounts/ge0ffrey


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.