On Jun 5, 2008, at 1:32 PM, Shawn Wilsher wrote:

> On Thu, Jun 5, 2008 at 4:04 PM, D. Richard Hipp <[EMAIL PROTECTED]> wrote:
>> I think the solution might be as simple as compiling with -
>> DSQLITE_ENABLE_LOCKING_STYLE=1.  This option only works on a Mac.  It
>> enables some Apple-contributed code that does file locking that works
>> on AFP as well as on other network filesystems that the Mac supports.
> Would this change out locking works on a normal local file system?
>>

With SQLITE_ENABLE_LOCKING_STYLE turned on, SQLite calls statfs() to  
figure out what type of filesystem the database is found on and uses a  
locking style appropriate for that filesystem.  It prefers to use  
posix advisory locks if at all possible, so for most systems there  
would be no change in behavior.

The bug here is that the same file might be on AFP for one machine but  
a local mount on another machine.  If both machines try to use the  
database at the same time, they will use different and incompatible  
locking styles and will step on each other.  This is a theoretical  
problem which in practice it appears to never occur, so I won't worry  
too much about it.  But you should be aware of it.

SQLITE_ENABLE_LOCK_STYLE is not a setting we habitually test prior to  
a release, so if you decide to use it, please let me know so that I  
can make sure we start testing it more thoroughly.

D. Richard Hipp
[EMAIL PROTECTED]



_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to