• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Deleting objects causes OutOfMemory...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Deleting objects causes OutOfMemory...


  • Subject: Deleting objects causes OutOfMemory...
  • From: "Shravan Kumar.M" <email@hidden>
  • Date: Wed, 16 May 2007 20:55:11 +0530

Hi Group,

I have following Entities and their relationships:

A <---->> D
B <---->> D
C <---->> D

i.e., from entity 'D' to entities 'A', 'B' or 'C' it is a to-one relationship and from other side to entity 'D' is to-many.

Now, from in EO class of 'A' I am trying to delete the entity 'D' objects as follows:

public void deleteDs(){ 
NSArray dObjs = new NSArray(ds());//ds is a to-many relationship from A to D , A ---->> D

        for ( int i=0, count= dObjs.count(); i < count; i++ ) {
            D dObj = (D) dObjs.objectAtIndex(i);
            removeObjectFromBothSidesOfRelationshipWithKey(d, "ds");
        }

editingContext().saveChanges();
}

Problem:

1) Causing OutOfmemory when I do this operation.
2) When editingContext().saveChanges(); is invoked, it is first fetching all the "D" objects as follows:
SELECT dCol1,dCol2 FROM D WHERE c_d = 12345 . 
Donno why select query is referring only to c_d and not including a_d and b_d which are foreign keys to C,A,and B tables respectively in D.

I believe that OutOfmemory is caused due to above fetch. Could you please suggest how to resolve this issue and why deleting of objects is fetching the objects in to the memory in an improper way.

Looking forward to your valuable responses. Let me know if you need any other information.


Thanks & Rgds,
Shravan Kumar.M

"Let us learn from the past to profit by the present,and from the present to live better in the future."
--William WordsWorth
---------------------------------------------------------------


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Deleting objects causes OutOfMemory...
      • From: Robert Walker <email@hidden>
    • Re: Deleting objects causes OutOfMemory...
      • From: Lachlan Deck <email@hidden>
    • Re: Deleting objects causes OutOfMemory...
      • From: Kieran Kelleher <email@hidden>
  • Prev by Date: Re: Interrupting a fetch that is taking too long
  • Next by Date: Deploying problem an Eclipse project...
  • Previous by thread: auto open URL
  • Next by thread: Re: Deleting objects causes OutOfMemory...
  • Index(es):
    • Date
    • Thread