Re: [sqlite] WAL for single user database on NFS and Solaris

2011-01-30 Thread Ginn Chen

On Jan 31, 2011, at 12:26 PM, Dan Kennedy wrote:

> If you set "PRAGMA locking_mode=EXCLUSIVE" before reading or
> writing the WAL-mode database it might work.
> 
>   http://www.sqlite.org/wal.html#noshm
> 
> Dan.

Thanks, with sqlite 3.7,.4, it works if I run "PRAGMA locking_mode=EXCLUSIVE" 
as the very first command.

Ginn
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] WAL for single user database on NFS and Solaris

2011-01-29 Thread Ginn Chen
I think a single process accessing a single Sqlite database at a time over NFS 
is supposed to be fine.

But it is not working on Solaris.
On Solaris, man page of mmap() has

 EAGAINThe file to be  mapped  is  already  locked  using
   advisory   or   mandatory   record   locking.  See
   fcntl(2).

I found if the file on NFS has been locked with fcntl(), mmap() may fail.
It doesn't fail if both l_start and l_end are 0.

Thus, I got "Error: disk I/O error" for any operation after setting 
journal_mode to WAL.
See https://bugzilla.mozilla.org/show_bug.cgi?id=629296

The problem is setting journal_mode to WAL is successful, but it cannot be set 
back.
User has to move the db file to another filesystem and set journal_mode to 
delete.

I guess -DSQLITE_SHM_DIRECTORY="/var/tmp" might be a solution, but it is 
unsupported.

Any idea how can we make the behavior better on Solaris?
Maybe fallback to another lock method if it is on NFS?

BTW: With the same NFS server, sqlite3 works fine on Linux and Mac OS X.

Thanks,

Ginn
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users