Re: Clearing the application's object cache
Re: Clearing the application's object cache
- Subject: Re: Clearing the application's object cache
- From: Mike Schrag <email@hidden>
- Date: Thu, 3 Aug 2006 13:22:53 -0400
See also http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/
Using_EOF/Caching_and_Freshness
ms
On Aug 3, 2006, at 12:40 PM, Paul Lynch wrote:
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:
40mdimension.com
This email sent to email@hidden
_______________________________________________
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