核心数据:更新max pk失败 [英] Core Data: Updating max pk failed

查看:199
本文介绍了核心数据:更新max pk失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用核心数据的可可应用程序。一切似乎工作正常。



但是,在一个非常具体的情况下,应用程序对我们的客户来说是非常奇怪的。



日志显示这在输出中出现多次(我从未在测试中看到):

 核心数据:注释: -executeRequest:encountered exception =更新max pk失败:with userInfo = {
NSSQLiteErrorDomain = 14;
}

有没有人看过这封邮件,你知道这是什么意思吗?我尝试谷歌搜索,但发现没有信息,除了几个留言板关于Growl应用程序有类似的问题,没有解决方案还没有可用。



对不起,我可以'更具体的关于什么原因,因为我甚至不确定自己。我知道如何在客户端的机器上再现这个消息,但是这个消息似乎很随机。



我希望有人能给我更多的信息,我可以缩小一些。现在我很无能。



注意:这出现在运行10.7.2的macbook pro上(如果这很重要)。


$



更新



托管上下文save方法也失败,出现以下错误:


< >

无法完成操作。 (可可错误134030)




解决方案

真的是一个核心数据问题本身,但更多的一个问题,你处理运行的文件描述符。



每个进程有有限数量的文件描述符。如果你用完了,Core Data(和许多其他东西)将停止工作,因为他们不能再打开文件 - 任何他们会失败。



首先,请确保您不会泄露文件描述符,即确保在不再需要文件时关闭文件。



我不知道您的更改重新尝试跟踪。请查看跟踪文件系统更改



如果您是10.7,请查看调度源和 DISPATCH_SOURCE_TYPE_VNODE ,用于跟踪文件系统更改的非常强大的工具(对应于 kqueue ,但更容易使用)。


I have a cocoa app which uses core data. Everything seems to be working fine.

However, in a very specific scenario the app was behaving very strangely for our client.

In particular the logs shows this appearing in the output many times (which I've never seen in my testing):

Core Data: annotation: -executeRequest: encountered exception = Updating max pk failed:  with userInfo = {
NSSQLiteErrorDomain = 14;
}

Has anyone ever seen this message and do you know what it means? I've tried googling it but found no information other than a few message boards regarding the Growl app having similar problems, with no solution yet available.

Sorry that I can't be more specific regarding what causes this as I'm not even sure myself. I know how to reproduce this on the client's machine but this message seems very random.

I was hoping someone could give me some more information as to what this error means exactly so that I can maybe narrow it down some more. Right now I'm pretty clueless.

Note: This appears on a macbook pro running 10.7.2 (if that matters).

Thanks for any kind of help you can provide, even something vague would help me at this point.

Update:

The managed context "save" method also fails with the following error:

The operation couldn’t be completed. (Cocoa error 134030.)

解决方案

This is not really a Core Data problem as such, but more an issue of you process running out of file descriptors.

Each process has a limited number of file descriptors. If you run out, Core Data (and many other things) will stop working, because they can no longer open files -- any they'll fail.

First of all, make sure you're not leaking file descriptors, i.e. make sure you close files when you no longer need them.

I'm not sure what kind of changes you're trying to track. Take a look at Tracking File-System Changes.

If you're on 10.7, take a look at dispatch sources and DISPATCH_SOURCE_TYPE_VNODE for a very powerful tool to track file system changes (corresponds to kqueue, but is easier to use).

这篇关于核心数据:更新max pk失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆