Re: Multi-User using Core Data?
Re: Multi-User using Core Data?
- Subject: Re: Multi-User using Core Data?
- From: Bill Bumgarner <email@hidden>
- Date: Tue, 5 Jul 2005 12:54:30 -0700
On Jul 5, 2005, at 11:58 AM, Frank Illenberger wrote:
Case2: (mixed direct + AFP)
The file resides on the machine of ClientA. ClientA accesses the
file directly. ClientA activates personal file sharing for his
account and ClientB accesses the file via AFP.
--->This does not work. After few actions, I get "database is
locked" exceptions even if only one client tries to write to the file.
I understand that Case2 is a special one. But for small workgroups
in small companies it is a very common case.
Is there any way to achieve a correct locking behavior with sqlite
in this setup? Perhaps by using locking files etc.? How can I
activate the use of locking files with CoreData?
I'm surprised by the claim that is a common case. Usually, I saw one
machine acting as a server with the rest as clients. I suppose that
use of personal filesharing could lead to this situation.
In any case...
It doesn't sound like the failure was out of line with the expected
behavior. That is, you will generally see really weird locking
failures when mixing lock types because of the way the underlying
filesystem locks work.
As you surmised, you would need to fall back to using .lock files (or
equivalent) everywhere.
Likely, the easiest approach is to maintain .lock files yourself and
ensure that all read/write-- yes, read and write-- operations are
surrounded by calls to install/remove the .lock files, as
appropriate. You could use the API in sqlite3.h (end of file) as
that is global to all SQLite database connections, but the end result
will be less efficient. In particular, if you maintain your own lock
files, then SQLite will use the most efficient locking mechanism for
the target filesystem.
b.bum
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden