Re: Questions about Core Data and SQLite
Re: Questions about Core Data and SQLite
- Subject: Re: Questions about Core Data and SQLite
- From: Steve Steinitz <email@hidden>
- Date: Tue, 15 Jul 2008 11:05:23 +1000
Hi,
On 14/7/08, email@hidden wrote:
On Jul 14, 2008, at 8:12 AM, Chris Hanson wrote:
However, managing simultaneous access by *different users* to a
SQLite persistent store is slightly trickier -- they must all
access the persistent store in ways that have compatible file
locking. This is necessary to maintain database integrity.
However, if all you have are a couple of users on a LAN
working with a database stored on a shared AFP (AppleShare,
Personal File Sharing) volume, that should be fine.
The real difficulty is scaling. Any database that works via a
shared filesystem will have significant limits to its
scalability. You won't want to have more than a few users
sharing the same file.
I use a little gigabit Thecus Network Drive which is just about
as fast as using the internal disk. Humorously, my database
currently fits in the Thecus' cache so it runs even faster.
The only problem I have with multiple users accessing the
database is that the app throws optimistic locking exceptions.
They don't seem to result in anything bad but they are
worrying. I've tried running this code before saving:
[context processPendingChanges]; // added 4 Jul 08
double stalenessInterval = [context stalenessInterval];
[context setStalenessInterval: 1];
@try
{
[context refreshObject: sale mergeChanges: YES];
}
@catch (id e) ...
[context setStalenessInterval: stalenessInterval];
But it doesn't seem to do the merge: the in-memory object
remains different than the store.
Other than that it all works well and might scale OK too.
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