Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Cascade REMOVE

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 {
> ...
>   @OneToMany(mappedBy="study", cascade={CascadeType.REMOVE, 
> CascadeType.MERGE, CascadeType.PERSIST})
>     private java.util.List<StudyAuthor> studyAuthors;
> ...
> }
> @Entity
> public class StudyAuthor implements {
>  ...
>     @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

--- James Sutherland
 EclipseLink ,
Wiki: EclipseLink , TopLink 
Forums: TopLink , EclipseLink 
Book: Java Persistence 
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top