Re: core data, refreshObject, multiple threads
Re: core data, refreshObject, multiple threads
- Subject: Re: core data, refreshObject, multiple threads
- From: Steve Steinitz <email@hidden>
- Date: Sat, 6 Dec 2008 11:04:23 +1100
Hi Chris,
On 5/12/08, Chris Idou <email@hidden> wrote:
I've got a main thread that handles a gui, and a worker thread
with its own persistentStoreCoordinator and
managedObjectContext. The gui notifies the worker thread of a
change, passing it an objectID, and the worker thread gets the
object, and other objects it is connected to, and calls
[managedObjectContext refreshObject: on them.
But they don't seem to get an updated object. I'm using the XML
store. The store is saved, I've checked that the new values are
in the XML. But refresh doesn't seem to update anything. Is
there any trick to it?
Yes, I believe there are some tricks and also possibly some
cases where it just won't update anything. Ben Trumbull was
kind enough to contribute to a similar question I posted back in
October. Here is the thread: http://www.mail-archive.com/email@hidden/msg19221.html
In particular see his comment about the issue with small
staleness intervals. At the time, I thought that had solved my
problem but I've since discovered other scenarios where
refreshObject doesn't update anything. Its possibly more likely
to occur after optimistic locking errors (which, so far, I am
unable to avoid). But I haven't yet demonstrated that with any
degree of scientific method. I'm going to put it under the
microscope again over the Christmas holidays. Feel free to stay
in touch about it.
Best regards and best of luck,
Steve
_______________________________________________
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