• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Core Data SQLite store appears corrupted only when using migratePersistentStore
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data SQLite store appears corrupted only when using migratePersistentStore


  • Subject: Core Data SQLite store appears corrupted only when using migratePersistentStore
  • From: Dave Fernandes <email@hidden>
  • Date: Sun, 6 Jan 2008 13:45:33 -0500

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.

Here is the code snippet to migrate NSPersistentDocument *doc:

NSPersistentStoreCoordinator* psc = [[doc managedObjectContext] persistentStoreCoordinator];
id oldStore = [psc persistentStoreForURL:[doc fileURL]];
NSError* error = nil;
[psc migratePersistentStore:oldStore toURL:newURL
options:nil withType:LIBRARY_STORE_TYPE error:&error];




The console message I get is the following:

2008-01-06 13:25:42.755 MyApp[1331] Fetch instances of entity (NSEntityDescription) name Analysis, managedObjectClassName Analysis, isAbstract 1, superentity name (null), properties {

...<many lines deleted here>...

}, subentities {

...<many lines deleted here>...

}, userInfo {} from store <NSSQLCore: 0x1632b510> failed, reason: NSError "The file could not be opened because it is not in the right format." Domain=NSCocoaErrorDomain Code=259 UserInfo={
NSUnderlyingException = Fatal error. The database at /Users/ davef/Library/Application Support/MyApp/Library.nlib is corrupted. SQLite error code:1;
}



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


Thanks in advance,
Dave Fernandes
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Core Data SQLite store appears corrupted only when using migratePersistentStore
      • From: Jim Correia <email@hidden>
  • Prev by Date: The temporary directory could not be deleted.
  • Next by Date: Re: Core Data SQLite store appears corrupted only when using migratePersistentStore
  • Previous by thread: The temporary directory could not be deleted.
  • Next by thread: Re: Core Data SQLite store appears corrupted only when using migratePersistentStore
  • Index(es):
    • Date
    • Thread