I'm doing a BEGIN EXCLUSIVE before every write statement already, should I
do it for read steatements as well?

-----Original Message-----
From: sqlite-users-boun...@mailinglists.sqlite.org
[mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of Simon
Slavin
Sent: Saturday, May 30, 2015 11:57 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Statistical SQLITE_BUSY_SNAPSHOT in WAL mode


On 30 May 2015, at 9:41pm, Samuel Tebeka <samtebeka at gmail.com> wrote:

> This is the official doc:
> 
> 1.    Process A starts a read transaction on the database and does one or
> more SELECT statement. Process A keeps the transaction open.
> 2.    Process B updates the database, changing values previous read by
> process A.
> 3.    Process A now tries to write to the database. But process A's view
> of the database content is now obsolete because process B has modified 
> the database file after process A read from it. Hence process B gets 
> an SQLITE_BUSY_SNAPSHOT error.
> 
> Do you have a recommendation about how to resolve this issue?

Around the commands which read and write to the database, try executing

BEGIN EXCLUSIVE
    the command
END

This should mean that the errors go away but it might slow down your
programs unacceptably.  Please tell us what happens.

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

Reply via email to