On 9 Feb 2018, at 10:50am, Leonard Lausen <leon...@lausen.nl> wrote:

> sqlite 3.22.0 added the ability to read from WAL mode databases even if
> the application lacks write permission on the database and its
> containing directory, as long as the -shm and -wal files exist in that
> directory.
> 
> Even though the wiki page states that WAL does not work over a network
> filesystem, I am able to use WAL over a network filesystem when using
> sqlite 3.22.0 as long as the respective -shm and -wal files exist. (This
> may or may not work with earlier versions.)

Yes, you are getting results for the pattern of access you tried.  That doesn't 
mean you'll not start getting error messages or corrupted files when you try 
something else.  The problem is not with reading files, it's with locking.

> Could someone clarify if this is intended or may result in database
> corruption? (I am only reading from the database on the remote host)

You note above unusual circumstances: "even if the application lacks write 
permission on the database and its containing directory".  

Will any of the processes accessing the database have write permission ?  If 
not, if they're all just reading the existing database, then there's no 
opportunity for corruption.  Think of it as

1) Reading a database while it's being written to may yield corrupt results.  
SQLite uses locking to avoid this.
2) Two processes writing a database at once will corrupt the database.  SQLite 
uses locking to avoid this.
3) Locking does not work properly across a network

and you'll figure out the danger scenarios.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to