Skip navigation.
 
ml[SOLVED] Re: Core Data SQLite store appears corrupted only when using migratePersistentStore
FROM : Dave Fernandes
DATE : Thu Jan 10 01:44:51 2008

The problem is that I changed an entity in the managed object model 
after creating the SQLite store. Since none of the entities in the 
store were of the changed entity type, I didn't run into any problems 
using the store. It looks like Core Data must compare managed object 
models and throw this exception if anything has changed, even if the 
differing entities are not used in the store.

The fix was to copy the objects in the corrupt store one-by-one into 
a new NSPersistentDocument, and save that new document. Then migrate 
this new document to a binary store.

Dave

On Jan 6, 2008, at 2:40 PM, Dave Fernandes wrote:

> sqlite3 integrity_check says the file is "ok". I also tried 
> vacuuming the file for good measure, but Core Data still can't 
> migrate it. (Same error message as before.)
>
>
> On Jan 6, 2008, at 2:10 PM, Jim Correia wrote:
>

>> On Jan 6, 2008, at 1:45 PM, Dave Fernandes wrote:
>>

>>> I am trying to migrate a persistent store from SQLite to binary 
>>> type. The SQLite store seems to be working OK -- I can read, edit 
>>> and write files -- however, when I try to migrate a know "good" 
>>> file, I get an error.

>>
>> [...]
>>

>>> Can anyone shed some light on why the file only appears to be 
>>> corrupted when I try to migrate it?

>>
>> If the file is corrupt (as opposed to a misleading error message), 
>> migrating would be more likely to expose the problem since it 
>> reads every nook and cranny of the file whereas your typical fetch/
>> insert/update does not.
>>
>> You can use the sqlite3 command line tool with "pragma 
>> integrity_check;" to find out whether sqlite thinks the file is 
>> corrupt or not.
>>
>> Jim
>>

>
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/dave.fernandes%
> 40utoronto.ca
>
> This email sent to dave.<email_removed>

Related mailsAuthorDate
mlCore Data SQLite store appears corrupted only when using migratePersistentStore Dave Fernandes Jan 6, 19:45
mlRe: Core Data SQLite store appears corrupted only when using migratePersistentStore Jim Correia Jan 6, 20:10
mlRe: Core Data SQLite store appears corrupted only when using migratePersistentStore Dave Fernandes Jan 6, 20:40
ml[SOLVED] Re: Core Data SQLite store appears corrupted only when using migratePersistentStore Dave Fernandes Jan 10, 01:44