Comment by mjw1007
5 years ago
When Subversion changed their working copy format to rely on an SQLite database, I had a number of problems using working copies on network file systems.
No doubt this was an indication that the network file system was incorrectly configured, but I think the fact that it worked in practice with the file-based format and didn't with the SQLite format is a strike against the idea of using SQLite for what the user sees as saving a file.
SQLite recommends against sharing it on NFS for multiple access because locking is broken on NFS for all kinds of files, not just SQLite.
> But use caution: this locking mechanism might not work correctly if the database file is kept on an NFS filesystem. This is because fcntl() file locking is broken on many NFS implementations. You should avoid putting SQLite database files on NFS if multiple processes might try to access the file at the same time.
Source: https://www.sqlite.org/faq.html#q5
Fair enough, but that means if someone's following the advice in the article ("It deserves your consideration as the standard file format on your next application design") they need to consider "will our users want to use our files on network filesystems?".
You could always have a lock file alongside the main to signal to other instances of the app that the file's in use. A bit janky, but workable.
1 reply →
Also WAL mode isn't going to work on network filesytems.
Working copies on network file systems are a horrible idea. You detected problems because you were using SQLite, but are you sure you didn't have silent corruption with older Subversion versions?