Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple persistent store coordinators gotchas?



On Oct 16, 2008, at 3:59 PM, Dave Dribin wrote:
On Oct 15, 2008, at 5:52 PM, Melissa J. Turner wrote:
Stale data is unlikely to be a problem unless you're expecting to load it significantly before you actually need it, which would be the same if you were loading it into a separate context on the same coordinator.

Just to clarify, stale data is only an issue for long-lived MOCs, not long-lived PSCs. For example, if we create 1 PSC for all the background threads to share for the lifetime of the app, but only create (or reset) MOCs just before report generation, there's minimal chance of stale data. These new/reset MOCs will always have fresh data?

I wrote a quick app to test this out and the PSCs are indeed independent, but only if you're using the SQLite store. Creating (or resetting) a MOC does indeed pick up changes that have been saved from another PSC.


For XML and binary stores, it seems that the store is completely read into memory when you call addPersistentStoreWithType:. For those types, you need to remove then re-add the persistent store, in addition to calling [moc reset] or creating a new MOC.

-Dave

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Multiple persistent store coordinators gotchas? (From: Dave Dribin <email@hidden>)
 >Re: Multiple persistent store coordinators gotchas? (From: "Melissa J. Turner" <email@hidden>)
 >Re: Multiple persistent store coordinators gotchas? (From: Dave Dribin <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.