Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Memory problem in Cascade Delete

jflackJul 24 2014 — edited Jul 31 2014

Using JDeveloper and ADF 12.1.2.0.

I have a master-detail relationship where there can be 200,000 or more details to a single master.  In the database, I created the FK constraint with the CASCADE DELETE option.  In the ADF BC, I set the Association Object between the two EOs with Composition Association checked, Optimize for Database Cascade Delete checked, and Implement Cascade Delete is automatically checked.

The cascade delete works fine - when the user deletes a master record, its details are also deleted.  At least it works as long as the particular master only has say, 50,000 details.

But the more details there are, the more memory is used on the server, when a master record is deleted.  With the larger detail sets (say, more than 50,000 details), this can cause an "out of memory" error, and then the server (WebLogic 12.1.2.0) crashes.

I'm not sure I understand why it is behaving as if it is bringing ALL the detail records into memory to do the delete, when the actual delete activity should be all database-side.  Anything I can do about this?  Or do we just have to give the server lots of memory and hope for the best?

This post has been answered by jflack on Jul 31 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2014
Added on Jul 24 2014
19 comments
3,421 views