-->
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: "deleted object would be re-saved by cascade" ??
PostPosted: Fri Oct 06, 2006 12:24 pm 
Newbie

Joined: Thu Oct 05, 2006 11:34 am
Posts: 8
I have got two entity pojos
-Contact
-Group
The relation between Contact and Group is that One group can have many contacts
Now to delete the Contact by its id first i load the Contact object for that id
Then i delete that contact object
but while running the application i get the following error
Exception in thread "main" org.springframework.dao.InvalidDataAccessApiUsageException: deleted object would be re-saved by cascade (remove deleted object from associations): [com.sample.Contact#3]; nested exception is org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations):

What does this error actually means and how to solve this problem

_________________
.::hIBERNATe rOCKs::.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 08, 2006 6:34 pm 
Beginner
Beginner

Joined: Thu Oct 06, 2005 8:14 pm
Posts: 23
Did you find the answer for this one...
I seem to have come across a similar issue as well.......


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 09, 2006 5:16 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you forgot to do contact.setGroup(null), ie update both sides of the relationship

_________________
Emmanuel


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.