Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Understanding 1-many deletion cascading
Understanding 1-many deletion cascading [message #1069871] Tue, 16 July 2013 19:27
Roger Spall is currently offline Roger Spall
Messages: 17
Registered: January 2013
Junior Member
Consider TWO 1-many relationships. The first has no back-reference from the child to the parent, while the second one does.

Both 1-many relationships specify cascade-remove. But the deletion sql is very different. In the first case (no back reference) Eclipselink executes a single sql statement (paraphrased below):

delete from child-table where parent-oid-column = parent-oid


However, in the second example (child has many-to-one back reference), Eclipselink execute multiple delete statements, one for each child in the 1-many relationship for the parent being deleted:

delete from child-table where child-oid-column = child-oid
delete from child-table where child-oid-column = child-oid
delete from child-table where child-oid-column = child-oid
.....


Of course, the effect is the same but when I have a very large collection (1000 + items) it a slower!

Why does Eclipselink need to take the second approach just because I specify a back reference in the child. Clearly I am not understanding something subtle about my object model.
Previous Topic:private-owned versus orphan-removal versus cascade-remove
Next Topic:cascade-remove bug with UOW
Goto Forum:
  


Current Time: Sun Sep 21 18:24:48 GMT 2014

Powered by FUDForum. Page generated in 0.03909 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software