• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
re: Core Data merge and "statement is still active" error?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Core Data merge and "statement is still active" error?
      • From: Michael Link <email@hidden>
  • Prev by Date: re: CoreData file format stability
  • Next by Date: Re: Frame rate check
  • Previous by thread: Core Data merge and "statement is still active" error?
  • Next by thread: Re: Core Data merge and "statement is still active" error?
  • Index(es):
    • Date
    • Thread