核心数据错误:SQLite错误代码:1,'无法回滚 - 没有事务处于活动状态'

时间:2013-03-18 13:54:42

标签: objective-c sqlite core-data

我在控制台中收到此错误,之后只有错误。错误以随机顺序出现。某些数据库更改并保存,直到出现错误。

我尝试清理项目,从手机中删除应用并重新启动手机。 在模拟器中它工作正常!我尝试使用3GS并且工作正常,我只是尝试使用4 / 4S并且出现同样的问题!

日志:

CoreData: sql: BEGIN EXCLUSIVE
CoreData: annotation: getting max pk for entityID = 2
CoreData: annotation: updating max pk for entityID = 2 with old = 19 and new = 20
CoreData: sql: ROLLBACK
CoreData: annotation: total fetch execution time: 0.2242s for 1 rows.
CoreData: sql: SELECT 0, t0.Z_PK, t0.Z_OPT, t0.ZJIDSTR, t0.ZLASTUPDATED, t0.ZPHOTOHASH, t0.ZWAITINGFORFETCH, t0.ZVCARDAVATARREL, t0.ZVCARDTEMPREL FROM ZXMPPVCARDCOREDATASTORAGEOBJECT t0 WHERE  t0.ZJIDSTR = ?  LIMIT 1
CoreData: details: SQLite bind[0] = "XXXXXXXXXXXXXXXXX"
CoreData: annotation: sql connection fetch time: 0.0128s
CoreData: details: SQLite bind[11] = "oIBWsotpJjWH8MAgnj9H56UtxXk="
CoreData: sql: COMMIT
CoreData: annotation: Disconnecting from sqlite database due to an error.
CoreData: error: (1) I/O error for database at /var/mobile/Applications/EB102CE9-77A8-4360-8D4E-3EEB55D21E8F/Library/ClientDB/StoreContent/persistentStore.  SQLite error code:1, 'cannot rollback - no transaction is active'

CoreData: annotation: Connecting to sqlite database file at "/var/mobile/Applications/EB102CE9-77A8-4360-8D4E-3EEB55D21E8F/Library/ClientDB/StoreContent/persistentStore"
CoreData: error: (14) unable to open database file

我唯一要做的事情是: 添加新实体,编辑属性。保存。 我正在使用UIManagedDocument。

从现在开始,我只会得到同样的错误,无法打开数据库。 我的代码中没有fopen。所以它不可能是文件描述错过使用。

0 个答案:

没有答案