objective c - Core Data: Database migration causes duplicates -


Reports of some customers compared to after main data migration, their database entries resulted in duplication.

The database we opened was sent to us and actually the entries are repeated. We restore backup and convert the database again, but we can not reproduce this problem in the office. Migration only works.

What could be the reason for this repetition? Is it related to the structure of the model, or something else?

This model is light migration using mapping core data databases are based on mysql.

Thank you

After the fight for a while, the solution is enough for us was clear. Since it is sometimes only very , it was difficult to find a repo (and also hard to find the reason).

It appears that the app sometimes uses mid-migration (for unknown reasons).

We are using the Define file names for destinationURL in - [NSMigrationManager migrateStoreFromURL: ...] as appdata.sqlite -model_version_2.3 . We were not checking the existence of the destination before migrating, and NSMigrationManager will be directly copied to it ... then we will get duplicate of each unit from the first (crashing) effort, and single < Code> .sqlite , .sqlite-shm

something - [remove NSFileManager ItemAtPath: error:] for call .sqlite-shm and .sqlite-wal to solve any previous failed migration to solve the problem before migration Is.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -