[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| 
Re: [eclipselink-users] Cascade REMOVE
 | 
I  did more testing, and the problem occurs only if I update the entity 
before removing it.  I will log the bug with an example.
Thanks,
Ellen
James Sutherland wrote:
Are there any other relationships in these two objects?  It could be some
sort of cyclic dependency.
If not, then please log the bug, and include as much information as
possible. (stack, SQL, remove code)
Ellen Kraffmiller wrote:
 
I'm running into another problem with EclipseLink in Glassfish - when I 
delete an Entity that has a collection defined with a OneToMany 
relationship, cascade REMOVE doesn't seem to be working.  The delete 
throws a foreign key violation error because the dependent entity is not 
deleted.  Here is a code snippet:
@Entity
public class Study implements java.io.Serializable {
...
 @OneToMany(mappedBy="study", cascade={CascadeType.REMOVE, 
CascadeType.MERGE, CascadeType.PERSIST})
   private java.util.List<StudyAuthor> studyAuthors;
...
}
@Entity
public class StudyAuthor implements java.io.Serializable {
...
   @ManyToOne
   private Study study;
...
}
This same code is working when I use TopLink Essentials.  Before 
entering a bug I just wanted to check if there is some configuration 
issue that may be causing this.
Thanks,
Ellen
   
-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence