CoreData / SQL hang on save
CoreData / SQL hang on save
- Subject: CoreData / SQL hang on save
- From: Greg Hoover <email@hidden>
- Date: Tue, 25 Aug 2009 02:19:28 -0700
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.
CoreData: sql: SELECT 0, t0.Z_PK FROM ZTRANSACTION t0 WHERE
t0.Z4STOPTRANSACTIONS = ?
CoreData: annotation: sql connection fetch time: 0.0004s
CoreData: annotation: total fetch execution time: 0.0006s for 0 rows.
CoreData: annotation: to-many relationship fault "stopTransactions"
for objectID 0x560060 <x-coredata://46056D7C-91E4-42C2-9119-AEB4FB4288D2/Stock/p2
> fulfilled from database. Got 0 rows
CoreData: sql: SELECT 0, t0.Z_PK FROM ZTRANSACTION t0 WHERE
t0.Z4STOPTRANSACTIONS = ?
CoreData: annotation: sql connection fetch time: 0.0003s
CoreData: annotation: total fetch execution time: 0.0006s for 0 rows.
CoreData: annotation: to-many relationship fault "stopTransactions"
for objectID 0x558f30 <x-coredata://46056D7C-91E4-42C2-9119-AEB4FB4288D2/Stock/p3
> fulfilled from database. Got 0 rows
CoreData: sql: SELECT 0, t0.Z_PK FROM ZTRANSACTION t0 WHERE
t0.Z4STOPTRANSACTIONS = ?
CoreData: annotation: sql connection fetch time: 0.0012s
CoreData: annotation: total fetch execution time: 0.0015s for 0 rows.
CoreData: annotation: to-many relationship fault "stopTransactions"
for objectID 0x562e80 <x-coredata://46056D7C-91E4-42C2-9119-AEB4FB4288D2/Stock/p4
> fulfilled from database. Got 0 rows
CoreData: sql: SELECT 0, t0.Z_PK FROM ZTRANSACTION t0 WHERE
t0.Z4STOPTRANSACTIONS = ?
CoreData: annotation: sql connection fetch time: 0.0073s
CoreData: annotation: total fetch execution time: 0.0096s for 0 rows.
CoreData: annotation: to-many relationship fault "stopTransactions"
for objectID 0x562e90 <x-coredata://46056D7C-91E4-42C2-9119-AEB4FB4288D2/Stock/p5
> fulfilled from database. Got 0 rows
CoreData: sql: BEGIN EXCLUSIVE
CoreData: sql: UPDATE ZSTOCK SET Z_OPT = ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: COMMIT
CoreData: sql: BEGIN EXCLUSIVE
CoreData: sql: UPDATE ZSTOCK SET ZEPS = ?, ZASK = ?, ZBID = ?, Z_OPT
= ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: UPDATE ZSTOCK SET ZEPS = ?, Z_OPT = ? WHERE Z_PK = ?
AND Z_OPT = ?
CoreData: sql: UPDATE ZSTOCK SET ZEPS = ?, Z_OPT = ? WHERE Z_PK = ?
AND Z_OPT = ?
CoreData: sql: SELECT Z_PK,Z_OPT FROM ZSTOCK WHERE Z_PK IN (1,2,3,4,5)
ORDER BY Z_PK
CoreData: annotation: sql execution time: 0.0011s
CoreData: sql: SELECT 0, t0.Z_PK, t0.Z_OPT, t0.ZFORWARDPE,
t0.ZLASTTIME, t0.ZMANUAL, t0.ZEPS, t0.ZANNUALEPS, t0.ZDAYRANGE,
t0.ZTRANSACTIONERROR, t0.ZOPEN, t0.ZDIV, t0.ZNEWS, t0.ZPERCENT,
t0.ZANNUALEPSDATE, t0.ZUPDATEREQUIRED, t0.ZMARKETCAP, t0.ZEXCHANGE,
t0.ZDATE, t0.ZCURRENCY, t0.ZMUTUALFUND, t0.ZLABEL,
t0.ZOPTIONEXPIRATION, t0.ZYEARRANGE, t0.ZCHARTS, t0.ZCURRENCYSET,
t0.ZONEYEAR, t0.ZTRANSACTIONCACHE, t0.ZHIGH, t0.ZEXCHANGEID,
t0.ZAVGVOL, t0.ZLABELCOLOR, t0.ZNEWSERRORS, t0.ZNAME, t0.ZCLOSE,
t0.ZCUSTOMNAME, t0.ZDIVIDENDYIELD, t0.ZDIVDATE, t0.ZLASTDATE,
t0.ZEXCHANGERATE, t0.ZENABLED, t0.ZASK, t0.ZQUARTERLYEPS, t0.ZBID,
t0.ZISOPTION, t0.ZALARMSTATUS, t0.ZLOW, t0.ZQUOTEERRORS, t0.ZLAST,
t0.ZSTRIKE, t0.ZALARMS, t0.ZVOLUME, t0.ZQUARTERLYEPSDATE, t0.ZCHART,
t0.ZSERVICES, t0.ZCHANGE, t0.ZUNREADNEWS, t0.ZNOTES, t0.ZPE,
t0.ZCLOSED, t0.ZPEG, t0.ZEXDIVDATE, t0.ZOPTIONTYPE, t0.ZCHARTERRORS
FROM ZSTOCK t0 WHERE t0.Z_PK = ?
CoreData: annotation: sql connection fetch time: 0.0008s
CoreData: annotation: total fetch execution time: 0.0013s for 1 rows.
CoreData: annotation: Optimistic locking failure for 0x51fc30 <x-coredata://46056D7C-91E4-42C2-9119-AEB4FB4288D2/Stock/p1
>. Row was updated.
CoreData: sql: SELECT 0, t0.Z_PK, t0.Z_OPT, t0.ZFORWARDPE,
t0.ZLASTTIME, t0.ZMANUAL, t0.ZEPS, t0.ZANNUALEPS, t0.ZDAYRANGE,
t0.ZTRANSACTIONERROR, t0.ZOPEN, t0.ZDIV, t0.ZNEWS, t0.ZPERCENT,
t0.ZANNUALEPSDATE, t0.ZUPDATEREQUIRED, t0.ZMARKETCAP, t0.ZEXCHANGE,
t0.ZDATE, t0.ZCURRENCY, t0.ZMUTUALFUND, t0.ZLABEL,
t0.ZOPTIONEXPIRATION, t0.ZYEARRANGE, t0.ZCHARTS, t0.ZCURRENCYSET,
t0.ZONEYEAR, t0.ZTRANSACTIONCACHE, t0.ZHIGH, t0.ZEXCHANGEID,
t0.ZAVGVOL, t0.ZLABELCOLOR, t0.ZNEWSERRORS, t0.ZNAME, t0.ZCLOSE,
t0.ZCUSTOMNAME, t0.ZDIVIDENDYIELD, t0.ZDIVDATE, t0.ZLASTDATE,
t0.ZEXCHANGERATE, t0.ZENABLED, t0.ZASK, t0.ZQUARTERLYEPS, t0.ZBID,
t0.ZISOPTION, t0.ZALARMSTATUS, t0.ZLOW, t0.ZQUOTEERRORS, t0.ZLAST,
t0.ZSTRIKE, t0.ZALARMS, t0.ZVOLUME, t0.ZQUARTERLYEPSDATE, t0.ZCHART,
t0.ZSERVICES, t0.ZCHANGE, t0.ZUNREADNEWS, t0.ZNOTES, t0.ZPE,
t0.ZCLOSED, t0.ZPEG, t0.ZEXDIVDATE, t0.ZOPTIONTYPE, t0.ZCHARTERRORS
FROM ZSTOCK t0 WHERE t0.Z_PK = ?
CoreData: annotation: sql connection fetch time: 0.0093s
CoreData: annotation: total fetch execution time: 0.0100s for 1 rows.
CoreData: annotation: Optimistic locking failure for 0x562e80 <x-coredata://46056D7C-91E4-42C2-9119-AEB4FB4288D2/Stock/p4
>. Row was updated.
CoreData: sql: ROLLBACK
CoreData: sql: BEGIN EXCLUSIVE
CoreData: sql: UPDATE ZSTOCK SET ZEPS = ?, Z_OPT = ? WHERE Z_PK = ?
AND Z_OPT = ?
CoreData: sql: SELECT Z_PK,Z_OPT FROM ZSTOCK WHERE Z_PK IN (1,2,3,4,5)
ORDER BY Z_PK
CoreData: annotation: sql execution time: 0.0004s
CoreData: sql: SELECT 0, t0.Z_PK, t0.Z_OPT, t0.ZFORWARDPE,
t0.ZLASTTIME, t0.ZMANUAL, t0.ZEPS, t0.ZANNUALEPS, t0.ZDAYRANGE,
t0.ZTRANSACTIONERROR, t0.ZOPEN, t0.ZDIV, t0.ZNEWS, t0.ZPERCENT,
t0.ZANNUALEPSDATE, t0.ZUPDATEREQUIRED, t0.ZMARKETCAP, t0.ZEXCHANGE,
t0.ZDATE, t0.ZCURRENCY, t0.ZMUTUALFUND, t0.ZLABEL,
t0.ZOPTIONEXPIRATION, t0.ZYEARRANGE, t0.ZCHARTS, t0.ZCURRENCYSET,
t0.ZONEYEAR, t0.ZTRANSACTIONCACHE, t0.ZHIGH, t0.ZEXCHANGEID,
t0.ZAVGVOL, t0.ZLABELCOLOR, t0.ZNEWSERRORS, t0.ZNAME, t0.ZCLOSE,
t0.ZCUSTOMNAME, t0.ZDIVIDENDYIELD, t0.ZDIVDATE, t0.ZLASTDATE,
t0.ZEXCHANGERATE, t0.ZENABLED, t0.ZASK, t0.ZQUARTERLYEPS, t0.ZBID,
t0.ZISOPTION, t0.ZALARMSTATUS, t0.ZLOW, t0.ZQUOTEERRORS, t0.ZLAST,
t0.ZSTRIKE, t0.ZALARMS, t0.ZVOLUME, t0.ZQUARTERLYEPSDATE, t0.ZCHART,
t0.ZSERVICES, t0.ZCHANGE, t0.ZUNREADNEWS, t0.ZNOTES, t0.ZPE,
t0.ZCLOSED, t0.ZPEG, t0.ZEXDIVDATE, t0.ZOPTIONTYPE, t0.ZCHARTERRORS
FROM ZSTOCK t0 WHERE t0.Z_PK = ?
CoreData: annotation: sql connection fetch time: 0.0020s
CoreData: annotation: total fetch execution time: 0.0026s for 1 rows.
CoreData: annotation: Optimistic locking failure for 0x51fc30 <x-coredata://46056D7C-91E4-42C2-9119-AEB4FB4288D2/Stock/p1
>. Row was updated.
CoreData: sql: SELECT 0, t0.Z_PK, t0.Z_OPT, t0.ZFORWARDPE,
t0.ZLASTTIME, t0.ZMANUAL, t0.ZEPS, t0.ZANNUALEPS, t0.ZDAYRANGE,
t0.ZTRANSACTIONERROR, t0.ZOPEN, t0.ZDIV, t0.ZNEWS, t0.ZPERCENT,
t0.ZANNUALEPSDATE, t0.ZUPDATEREQUIRED, t0.ZMARKETCAP, t0.ZEXCHANGE,
t0.ZDATE, t0.ZCURRENCY, t0.ZMUTUALFUND, t0.ZLABEL,
t0.ZOPTIONEXPIRATION, t0.ZYEARRANGE, t0.ZCHARTS, t0.ZCURRENCYSET,
t0.ZONEYEAR, t0.ZTRANSACTIONCACHE, t0.ZHIGH, t0.ZEXCHANGEID,
t0.ZAVGVOL, t0.ZLABELCOLOR, t0.ZNEWSERRORS, t0.ZNAME, t0.ZCLOSE,
t0.ZCUSTOMNAME, t0.ZDIVIDENDYIELD, t0.ZDIVDATE, t0.ZLASTDATE,
t0.ZEXCHANGERATE, t0.ZENABLED, t0.ZASK, t0.ZQUARTERLYEPS, t0.ZBID,
t0.ZISOPTION, t0.ZALARMSTATUS, t0.ZLOW, t0.ZQUOTEERRORS, t0.ZLAST,
t0.ZSTRIKE, t0.ZALARMS, t0.ZVOLUME, t0.ZQUARTERLYEPSDATE, t0.ZCHART,
t0.ZSERVICES, t0.ZCHANGE, t0.ZUNREADNEWS, t0.ZNOTES, t0.ZPE,
t0.ZCLOSED, t0.ZPEG, t0.ZEXDIVDATE, t0.ZOPTIONTYPE, t0.ZCHARTERRORS
FROM ZSTOCK t0 WHERE t0.Z_PK = ?
CoreData: annotation: sql connection fetch time: 0.0008s
CoreData: annotation: total fetch execution time: 0.0012s for 1 rows.
CoreData: annotation: Optimistic locking failure for 0x562e80 <x-coredata://46056D7C-91E4-42C2-9119-AEB4FB4288D2/Stock/p4
>. Row was updated.
CoreData: sql: ROLLBACK
CoreData: sql: BEGIN EXCLUSIVE
CoreData: sql: UPDATE ZSTOCK SET ZEPS = ?, ZASK = ?, ZBID = ?, Z_OPT
= ? WHERE Z_PK = ? AND Z_OPT = ?
CoreData: sql: UPDATE ZSTOCK SET ZEPS = ?, Z_OPT = ? WHERE Z_PK = ?
AND Z_OPT = ?
CoreData: sql: UPDATE ZSTOCK SET ZEPS = ?, Z_OPT = ? WHERE Z_PK = ?
AND Z_OPT = ?
CoreData: sql: SELECT Z_PK,Z_OPT FROM ZSTOCK WHERE Z_PK IN (1,2,3,4,5)
ORDER BY Z_PK
CoreData: annotation: sql execution time: 0.0003s
CoreData: sql: SELECT 0, t0.Z_PK, t0.Z_OPT, t0.ZFORWARDPE,
t0.ZLASTTIME, t0.ZMANUAL, t0.ZEPS, t0.ZANNUALEPS, t0.ZDAYRANGE,
t0.ZTRANSACTIONERROR, t0.ZOPEN, t0.ZDIV, t0.ZNEWS, t0.ZPERCENT,
t0.ZANNUALEPSDATE, t0.ZUPDATEREQUIRED, t0.ZMARKETCAP, t0.ZEXCHANGE,
t0.ZDATE, t0.ZCURRENCY, t0.ZMUTUALFUND, t0.ZLABEL,
t0.ZOPTIONEXPIRATION, t0.ZYEARRANGE, t0.ZCHARTS, t0.ZCURRENCYSET,
t0.ZONEYEAR, t0.ZTRANSACTIONCACHE, t0.ZHIGH, t0.ZEXCHANGEID,
t0.ZAVGVOL, t0.ZLABELCOLOR, t0.ZNEWSERRORS, t0.ZNAME, t0.ZCLOSE,
t0.ZCUSTOMNAME, t0.ZDIVIDENDYIELD, t0.ZDIVDATE, t0.ZLASTDATE,
t0.ZEXCHANGERATE, t0.ZENABLED, t0.ZASK, t0.ZQUARTERLYEPS, t0.ZBID,
t0.ZISOPTION, t0.ZALARMSTATUS, t0.ZLOW, t0.ZQUOTEERRORS, t0.ZLAST,
t0.ZSTRIKE, t0.ZALARMS, t0.ZVOLUME, t0.ZQUARTERLYEPSDATE, t0.ZCHART,
t0.ZSERVICES, t0.ZCHANGE, t0.ZUNREADNEWS, t0.ZNOTES, t0.ZPE,
t0.ZCLOSED, t0.ZPEG, t0.ZEXDIVDATE, t0.ZOPTIONTYPE, t0.ZCHARTERRORS
FROM ZSTOCK t0 WHERE t0.Z_PK = ?
CoreData: annotation: sql connection fetch time: 0.0003s
CoreData: annotation: total fetch execution time: 0.0005s for 1 rows.
CoreData: annotation: Optimistic locking failure for 0x51fc30 <x-coredata://46056D7C-91E4-42C2-9119-AEB4FB4288D2/Stock/p1
>. Row was updated.
CoreData: sql: SELECT 0, t0.Z_PK, t0.Z_OPT, t0.ZFORWARDPE,
t0.ZLASTTIME, t0.ZMANUAL, t0.ZEPS, t0.ZANNUALEPS, t0.ZDAYRANGE,
t0.ZTRANSACTIONERROR, t0.ZOPEN, t0.ZDIV, t0.ZNEWS, t0.ZPERCENT,
t0.ZANNUALEPSDATE, t0.ZUPDATEREQUIRED, t0.ZMARKETCAP, t0.ZEXCHANGE,
t0.ZDATE, t0.ZCURRENCY, t0.ZMUTUALFUND, t0.ZLABEL,
t0.ZOPTIONEXPIRATION, t0.ZYEARRANGE, t0.ZCHARTS, t0.ZCURRENCYSET,
t0.ZONEYEAR, t0.ZTRANSACTIONCACHE, t0.ZHIGH, t0.ZEXCHANGEID,
t0.ZAVGVOL, t0.ZLABELCOLOR, t0.ZNEWSERRORS, t0.ZNAME, t0.ZCLOSE,
t0.ZCUSTOMNAME, t0.ZDIVIDENDYIELD, t0.ZDIVDATE, t0.ZLASTDATE,
t0.ZEXCHANGERATE, t0.ZENABLED, t0.ZASK, t0.ZQUARTERLYEPS, t0.ZBID,
t0.ZISOPTION, t0.ZALARMSTATUS, t0.ZLOW, t0.ZQUOTEERRORS, t0.ZLAST,
t0.ZSTRIKE, t0.ZALARMS, t0.ZVOLUME, t0.ZQUARTERLYEPSDATE, t0.ZCHART,
t0.ZSERVICES, t0.ZCHANGE, t0.ZUNREADNEWS, t0.ZNOTES, t0.ZPE,
t0.ZCLOSED, t0.ZPEG, t0.ZEXDIVDATE, t0.ZOPTIONTYPE, t0.ZCHARTERRORS
FROM ZSTOCK t0 WHERE t0.Z_PK = ?
CoreData: annotation: sql connection fetch time: 0.0002s
CoreData: annotation: total fetch execution time: 0.0005s for 1 rows.
CoreData: annotation: Optimistic locking failure for 0x562e80 <x-coredata://46056D7C-91E4-42C2-9119-AEB4FB4288D2/Stock/p4
>. Row was updated.
_______________________________________________
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