• 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
Re: Core Data and Document Packages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data and Document Packages


  • Subject: Re: Core Data and Document Packages
  • From: "Timothy J. Wood" <email@hidden>
  • Date: Tue, 3 Jul 2007 18:55:10 -0700


On Jul 3, 2007, at 1:38 AM, Seth Willits wrote:
My document-based app has a document type which uses a package instead of just a single file to store data in, because there is a need to store related files inside the package as well. Currently I'm doing some relatively simple overloading of standard NSDocument methods to open and save the database by using a path based off of the -fileName.

One major problem with using file wrappers is ensuring atomic saves. If one of your save operations needs to update SQLite and add/ remove/update other files in the file wrapper, the only real option would be to make a copy of the entire wrapper, apply the changes (including the SQLite transaction) to the copy and then atomic swap the two wrapper directories using FSExchangeObjects or the like. At this point, you've lost most of the benefit of putting it in a SQLite database (at least in terms of save speed; there are obviously other benefits).


What I wouldn't give for a transactional filesystem with copy-on- write...

-tim

_______________________________________________

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


References: 
 >Core Data and Document Packages (From: Seth Willits <email@hidden>)

  • Prev by Date: Re: "Visible at Launch" again, with "least" example
  • Next by Date: Re: "Visible at Launch" again, with "least" example
  • Previous by thread: Re: Core Data and Document Packages
  • Next by thread: Re: Core Data and Document Packages
  • Index(es):
    • Date
    • Thread