On Thu, Nov 3, 2011 at 12:13 PM, Simon Slavin <slav...@bigfraud.org> wrote:
> > If I start getting contention issues (locks failing because of too many > concurrent attempts at access) then I'll look into using some PRAGMAs, > possibly switching to WAL. > > Several points: (1) You only have to set WAL mode once for the database. The database remembers that it is in WAL mode and all subsequent opens bring it back up in WAL mode again (until you deliberately change it out of WAL mode.) You do *not* have to set WAL mode every time you open the database file. (2) WAL really does give better concurrency since it allows other processes to continue reading while a single process is writing to the database. In rollback mode you can have one writer *or* multiple readers. In WAL mode you can have one writer *and* multiple readers. On a busy system, or in a system with long-running transactions, the difference can be significant. (3) Transactions commit a lot faster with WAL. Depending on your app, you might see a measurable performance improvement just by switching to WAL. (4) WAL mode is much more resistant to corruption following a power failure that occurs soon after the disk drive lied and said that content was committed to oxide when in fact it was still in a volatile track buffer. And pretty much all consumer-grade disk drives tell such lies these days. -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users