使用 iOS 进行多通道核心数据分块迁移
我正在尝试迁移大约 11Mb 的 iPhone/iPad sqlite 存储。它有大约三十个不同的实体,所有实体都非常相互关联。
在 3GS 上,这需要相当长的时间。即使是轻量级迁移也需要大约四分钟。
我想这是因为所有的关系都保存在记忆中。
阅读 Apple 迁移指南,它说对于大型数据集,一种方法是使用不同的映射模型进行多次传递。
一切都很好。但是,如果一个映射模型中的实体与另一个映射模型中的实体相关,您似乎无法执行此操作。事实上,在映射模型 xcmappingmodel 文件中,会生成类似于“can't auto generated value expression with nilapping name”的编译错误。
非常感谢任何提示。
非常感谢,
马克斯
I'm trying to migrate an iPhone/iPad sqlite store of about 11Mb. It has around thirty different entities, all quite heavily interrelated.
On a 3GS, it takes quite some time. Even a lightweight migration takes around four minutes.
I guess this is because all the relationships are held in memory.
Reading the Apple migration guide, it says that for large datasets, one approach is to do multiple passes using different mapping models.
All well and good. However, it seems that you can't do this if the entities in one mapping model are related to those in another. In fact, a compilation error is generated along the lines of "can't auto generate value expression with nil mapping name" in the Mapping Model xcmappingmodel file.
Any tips much appreciated.
Many thanks,
Max
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
难道您不能只使用新架构创建一个新数据库,然后通过读取旧数据库并将其插入新数据库来开始迁移过程吗?
Cant you just create a new database with the new scheema and then start the migration process by reading from the old one and inserting to the new one ?