On Tue, Aug 13, 2013 at 11:35 AM, Ralf Ramsauer <r...@ramses-pyramidenbau.de
> wrote:

> Now my Question:
> According to [4], it seems that NFS also has problems with sharing
> locks. So why does Sqlite make use of file locks instead of writing
> those locks (including a timestamp for expiration) inside the database
> file or by touching dotfiles for locking?
>

You cannot write into the database file to create a lock because that
presents a race condition if two processes are trying to lock at the same
time.

If you open using the "unix-dotfile" VFS, it will use dotfile locking.
However, you give up a lot of concurrency with this (since dot-files are
always exclusive locks and never reader/writer locks) and it is slower and
it does not work with WAL mode (which requires multiple reader/writer locks
per file) and if your process dies unexpectedly it will leave stale locks
that have to be removed by hand.


-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to