> I was under the apparently mistaken impression that starting any
transaction would block writes, even in WAL mode.

My problem was that I was using sqlite3_enable_shared_cache(true).  I
enabled this because I was under the impression that is required for
multiple connections to share an in-memory database (one opened with the
URL parameter "?mode=memory").  With a WAL database, the shared cache was
causing the readers to block the writer and vice-versa.  I fixed the
problem by opening the WAL database with the URL parameter
"?cache=private", and verified that readers no longer block the writer, the
writer does not block readers, and the readers see the snapshot of the
database that exists when they call BEGIN, regardless of later writes.

That is exactly what I was looking for in my feature suggestion #1.  #2 and
#3 (especially #2) would also be nice to have--they would allow a more
elegant and efficient solution to my problem--but I think I should be able
to get it working without them...

Reply via email to