-->
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: reinserting rolledback object graph with delete-orphan coll
PostPosted: Thu Jan 05, 2006 2:16 pm 
Beginner
Beginner

Joined: Mon Feb 23, 2004 5:11 pm
Posts: 39
Hibernate version: 3.0.5

I am getting the "donot change reference to a all-delete-orphan collection" in the following scenario (pseudo code):


Code:
tx = session.beginTransaction();
session.save(objectGraphA);  //goes thro fine
session.flush();
session.save(objectGraphB); // fails due to a data issue
session.flush();
tx.rollback(); //roll back due to the failure above
session.close


Both object graphs are sent back to the presentaion layer, where the data issue in objectGraphB is fixed . Then when I try to save the object graphs in a new session
Code:
tx = newSession.beginTransaction();
newSession.save(objectGraphA);  //it fails is here



objectGraphA has a bag with cascade set to all-delete-orphan and hibernate thinks the reference has changed on that collection. I kind of understand whats happening:

since the first save goes thro fine, the bag changes to a PersistentBag. But when it gets rolledback eventrually, re saving the same object graph with the persistentbag confuses hibernate.


But how do i solve this issue? Any help would be greatly appreciated.


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.