• 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: CoreData / SQL hang on save
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData / SQL hang on save


  • Subject: Re: CoreData / SQL hang on save
  • From: "Melissa J. Turner" <email@hidden>
  • Date: Tue, 25 Aug 2009 13:16:28 -0700


On Aug 25, 2009, at 02:19, Greg Hoover wrote:

I've run into a hang in CoreData save. I'm the single coordinator, multiple object contexts threading model and a SQL store (though it seems to happen with XML as well). The hang occurs inside the NSSQLCore and seems to just loop endlessly. The SQL output supports this. Requests performed at launch succeed as expected, but the app quickly reaches a point where Optimistic locking failure exceptions are thrown with an endless sequence of ROLLBACKs followed by UPDATEs. All of the contexts are using the MergeByPropertyObjectTrump merge policy.

Any insight would be much appreciated.



There is a known issue on 10.5.* that results in Core Data entering an infinite loop during save if the database has been corrupted such that the optimistic locking column is set to NULL.


A way to tell would be to run sqlite3 on the database and execute the following SQL statement:

select Z_PK, Z_OPT from ZSTOCK where Z_PK IN (1, 4);

I'm guessing you'll get back something that looks like:

1|
4|

Which means that something has stuffed unexpected NULLs into your database.

The issue has been fixed in 10.6, but the only real workaround on 10.5.* is to manually repair the database by setting the value of the Z_OPT column to be non-null (1 is always a good option).

Cheers,
+Melissa



_______________________________________________

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: CoreData / SQL hang on save
      • From: Greg Hoover <email@hidden>
References: 
 >CoreData / SQL hang on save (From: Greg Hoover <email@hidden>)

  • Prev by Date: Re: [IPhone 3.0] How do I make a UITextField the first responder?
  • Next by Date: Selection highlight in NSTextFieldCell
  • Previous by thread: CoreData / SQL hang on save
  • Next by thread: Re: CoreData / SQL hang on save
  • Index(es):
    • Date
    • Thread