On Aug 3, 2006, at 12:21 PM, 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?

Did you save the first editing context before nulling it?  Was it a child or peer editing context?  Did you also remove any references to the original EOs ?


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.

In general, it's not a problem to fetch some EOs, do some work, save, then start all over again with a new EC.  As Gavin has pointed out, use counting of snapshots actually works now, so in your scenario, there's no reason to invalidate objects.  If something outside of your app is going to modify the rows, you might want to change the default lag using setDefaultFetchTimestampLag on the editing context (it defaults to an hour I believe).


Is this the right way to do this:

EOEditingContext.rootObjectStore().invalidateAllObjects();

Thanks
Ricardo Parada

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

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