Re: Core Data Multiuser
Re: Core Data Multiuser
- Subject: Re: Core Data Multiuser
- From: Flavio Donadio <email@hidden>
- Date: Wed, 18 Jul 2012 14:48:03 -0300
Steve,
I agree with Apple, SQLite, you and every other sensible developer out there: I won't try this! :)
Cheers,
Flavio
On 18/07/2012, at 04:49, Steve Steinitz wrote:
> Hi Flavio,
>
> While Apple, SQLite, myself and any sensible software developer advise against it, Core Data can run multi-user by placing the database on a server which supports AFP (e.g. a fast Synology NAS over gigabit ethernet).
>
> SQLite has limited optimistic locking support, but the record locking will only work over AFP.
>
> As mentioned elsewhere, you still have the (big) problem of keeping the cached objects of each Mac up to date. We do it by getting fresh data from the database, then saving, every minute (plus or minus random seconds) during idle time. The "refresh" code is complicated, ugly and big -- with bad smells abounding.
>
> To make it work at all in Leopard and beyond (when Apple finally put their foot down on this abomination) you need to set a special Apple SQL pragma when creating your persistent store. Our line of code looks like this:
>
> [pragmaOptions setObject: [NSNull null] forKey: @"lock_proxy_file"];
>
> A retailer has been doing this for their Point of Sale (and back-office) on seven Macs for six years. We lost a little data a couple times in the early days and we occasionally get a glitch under heavy Saturday load, but we've tamed the beast and now it works surprisingly well -- and fast.
>
> Be warned that there are, as Ben Trumbull once colorfully observed, "sharp edges".
>
> Cheers,
>
> Steve
_______________________________________________
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