• 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 15:48:42 -0700

Could you try running with -com.apple.CoreData.SQLDebug 3?

I'm curious as to what's trying to bind that's causing this:

binding not implemented for this SQLType 7

Cheers, +Melissa


On Aug 25, 2009, at 14:12, Greg Hoover wrote:

Hi Melissa,

Thanks for you response.

The problem actually just started showing up in 10.6 (wasn't a problem in 10.4 or 10.5). :-/

The hang stopped for a few launches and reverted to its previous output: "binding not implemented for SQLType 7". But then it happened again... The SQL file does not have null values for any Z_OPT fields.


CoreData: sql: UPDATE ZSTOCK SET Z_OPT = ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: UPDATE ZSTOCK SET ZEPS = ?, ZASK = ?, Z_OPT = ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: UPDATE ZSTOCK SET ZOPEN = ?, Z_OPT = ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: UPDATE ZSTOCK SET Z_OPT = ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: UPDATE ZSTOCK SET Z_OPT = ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: UPDATE ZSTOCK SET Z_OPT = ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: UPDATE ZSTOCK SET ZEPS = ?, ZASK = ?, Z_OPT = ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: ROLLBACK
binding not implemented for this SQLType 7
safe save
CoreData: sql: BEGIN EXCLUSIVE
CoreData: sql: UPDATE ZSTOCK SET Z_OPT = ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: UPDATE ZSTOCK SET ZEPS = ?, ZASK = ?, Z_OPT = ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: UPDATE ZSTOCK SET ZOPEN = ?, Z_OPT = ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: UPDATE ZSTOCK SET Z_OPT = ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: UPDATE ZSTOCK SET Z_OPT = ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: UPDATE ZSTOCK SET Z_OPT = ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: UPDATE ZSTOCK SET ZEPS = ?, ZASK = ?, Z_OPT = ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: ROLLBACK
binding not implemented for this SQLType 7
CoreData: annotation: total fetch execution time: 0.0000s for 0 rows.
CoreData: annotation: total fetch execution time: 0.0000s for 0 rows.
safe save


Thanks,
Greg

On Aug 25, 2009, at 1:16 PM, Melissa J. Turner wrote:


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


References: 
 >CoreData / SQL hang on save (From: Greg Hoover <email@hidden>)
 >Re: CoreData / SQL hang on save (From: "Melissa J. Turner" <email@hidden>)
 >Re: CoreData / SQL hang on save (From: Greg Hoover <email@hidden>)

  • Prev by Date: Re: Beware: trivially reproducible NSPersistentDocument crash when saving
  • Next by Date: Re: Core Data dog-slow when using first time after boot
  • Previous by thread: Re: CoreData / SQL hang on save
  • Next by thread: [IPhone 3.0] How do I make a UITextField the first responder?
  • Index(es):
    • Date
    • Thread