• 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
Re: Clearing the application's object cache
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clearing the application's object cache


  • Subject: Re: Clearing the application's object cache
  • From: Paul Lynch <email@hidden>
  • Date: Thu, 3 Aug 2006 17:40:40 +0100


On 3 Aug 2006, at 17:21, Ricardo Parada wrote:

If I create an editing context, then read some EOs into memory. Then I throw away the editing context by assigning null to the variable referencing the editing context.

Then I create a new editing context and read the same EOs into memory. Will the EOs have the same data as the ones read into memory when I created the first editing context?

Maybe; it depends. When GC runs, your ec and all snapshots will be released, assuming that you haven't held on to any eo references outside of the ec, but you have no practical way of guessing when that will be, apart from forcing GC. Do you want them to be the same, or are you expecting to pick up changes from an external source?


Anyways, I guess what I'm looking for is an effective way to read in some EOs into memory, perform some work, save the changes and then clear the application's object cache and start over. This is not a web app. It is a background process that does some analysis. So every time I read my EOs the entire object graph has to have fresh data from the database.

Is this the right way to do this:

EOEditingContext.rootObjectStore().invalidateAllObjects();

Not really. It will work (I think), but isn't very efficient, and probably depends on how you have you editing context and object stores organised. Nullify and GC is the correct way to do this. Check the usual options on fetch specs, the fetch lag value, etc.


As usual, expect a few diverse opinions to follow up :-).

Paul
_______________________________________________
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: Clearing the application's object cache
      • From: Mike Schrag <email@hidden>
References: 
 >Clearing the application's object cache (From: Ricardo Parada <email@hidden>)

  • Prev by Date: Re: Clearing the application's object cache
  • Next by Date: Re: WOB 5.3.1 deleting components WTF?
  • Previous by thread: Re: Clearing the application's object cache
  • Next by thread: Re: Clearing the application's object cache
  • Index(es):
    • Date
    • Thread