-->
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: SaveOrUpdateCopy vs SaveOrUpdate
PostPosted: Wed Jan 04, 2006 8:01 pm 
Newbie

Joined: Wed Feb 04, 2004 2:33 pm
Posts: 10
Consider the following object graph.

A --> *B --> *C --> *D

( ie A has parent/child to many Bs, which has parent/child to many Cs, etc.)

All are mapped with cascade "all-delete-orphan"

If I do the following code:

a.B_Collection.Remove(b);
b.A = null;

( note that this orphans the entire subtree from B down )

then create a brand new session and save using SaveOrUpdateCopy(A), I get an exception about "deleted object will be re-saved" referring to B I have completely removed the reference to B from A.

if I use SaveOrUpdate, it works.

Why the difference?


Hibernate version:
NHibernate 0.9


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.