-->
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: Bug In 3.6.10 -- Help Creating Test Case
PostPosted: Fri Jan 11, 2013 4:23 pm 
Newbie

Joined: Fri Jan 11, 2013 4:16 pm
Posts: 3
I think I have discovered a bug in hibernate 3.6.10, but am having trouble creating a test case. I describe the bug here:

https://hibernate.onjira.com/browse/HHH-7920

To replicate it, I need to setup two entities with a bidirectional OneToMany(cascade=CascadeType.ALL, mappedBy=)/ManyToOne relationship.
Next I need to save the Parent entity (on the one side) without any children.
Finally I need to retrieve the Parent entity from the database, so that it's children collection is actually a PersistentBag under the hood.

Once this stage is set, the following steps reproduce the bug:
Code:
parent.children.add(new Child()); //write is queued because !initialized && isConnectedToSession() && isInverseCollection()
parent.children.size(); //triggers PersistentBag::read(), which triggers an initialize()
//AT THIS POINT THE BUG HAS TECHNICALLY OCCURRED.. my transient entity (which was queued for write) has been added to the snapshot that is supposed to represent the collection before any changes.

//now call flush() or anything that will eventually call children.getOrphans(). Exception will result


I'm sorry to be such a helpless noob... I've been using hibernate for a few years now and would love to give back. Any pointers you guys could give me about building a valid test case would be great.

Thanks again,

-John


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.