Re: Multiple persistent store coordinators gotchas?
Re: Multiple persistent store coordinators gotchas?
- Subject: Re: Multiple persistent store coordinators gotchas?
- From: Dave Dribin <email@hidden>
- Date: Fri, 17 Oct 2008 16:12:40 -0500
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:
This email sent to email@hidden