-->
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: Misleading Error Message with "all-delete-orphan"
PostPosted: Fri May 26, 2006 10:10 am 
Regular
Regular

Joined: Wed Nov 17, 2004 11:49 am
Posts: 65
Location: Pittsburgh
I was seeing this problem on version 3.2.0.cr2:

Code:
Don't change the reference to a collection with cascade="all-delete-orphan"


After much tracing through the code to be sure that I wasn't actually dereferncing the collection, I realised that the problem was that I was:

Code:
save(entity);


but that I needed to:

Code:
saveOrUpdate(entity); //entity is already in database, although there are new child rows.


It is interesting to me that other types of cascade, "save-update" and "all" do not have a similar issue. At least, they didn't complain about save vs. saveOrUpdate. Anyway, maybe I can save someone else the time that I wasted tracking this down with this post.

If it makes a difference, the relationship was relatively involved, if not atypical:

parent (1) < -- > (1..*) {ordered} children lazy="false", cascade="all-delete-orphan"


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 18, 2007 6:37 am 
Beginner
Beginner

Joined: Thu Aug 11, 2005 5:19 am
Posts: 29
Thanks for this one!
It really saved my ass :)


Top
 Profile  
 
 Post subject: Re: Misleading Error Message with "all-delete-orphan"
PostPosted: Tue Jun 30, 2009 10:29 pm 
Newbie

Joined: Tue Aug 26, 2008 6:05 pm
Posts: 6
Cheers, I had this problem also.


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.