re: Core Data merge and "statement is still active" error?
re: Core Data merge and "statement is still active" error?
- Subject: re: Core Data merge and "statement is still active" error?
- From: Ben Trumbull <email@hidden>
- Date: Tue, 3 Jun 2008 18:52:22 -0400
Michael,
This error is almost always a multi-threading problem. When you used
the _debug version of Core Data, did you enable the threading
assertions with the user default -com.apple.CoreData.ThreadingDebug
3 ? What version of OSX are you using ? Is there a reason you're not
using Core Data's -mergeChangesFromContextDidSaveNotification: ?
If the object is modified (inserted, update, or deleted), you should
pass in YES to -refreshObject:mergeChanges:
It seems that sometimes the call to
mergeChangesFromContextDidSaveNotification: causes an error that shows
up in the output as "statement is still active". It appears that
object controllers that are bound to a managed object context receive
a notification "_NSObjectsChangedInManagingContextPrivateNotification"
and they do some fetching and the error occurs when they do a fetch
request.
This implies you're modifying a MOC on a background thread that's
bound into Cocoa Bindings. Cocoa Bindings and much of AppKit expect
to effectively own their objects on the main thread. Whichever MOC
the object controllers are observing is probably being misused.
- Ben
_______________________________________________
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