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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/mschrag% 40mdimension.com

This email sent to [EMAIL PROTECTED]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to