On Thu, 22 Feb 2018 14:36:07 +0000, Simon Slavin
<slav...@bigfraud.org> wrote:

> On 22 Feb 2018, at 11:24am, Clemens Ladisch <clem...@ladisch.de> wrote:
>> Use "BEGIN IMMEDIATE" instead to tell the DB that you intend to write.
> Depending on how you want your locks to work, BEGIN EXCLUSIVE may work better.

Yes, but note:  "After a BEGIN IMMEDIATE, no other database
connection will be able to write to the database or do a BEGIN
IMMEDIATE or BEGIN EXCLUSIVE. Other processes can continue to
read from the database, however. 
An exclusive transaction causes EXCLUSIVE locks to be acquired
on all databases. After a BEGIN EXCLUSIVE, no other database
connection except for read_uncommitted connections will be able
to read the database and no other connection without exception
will be able to write the database until the transaction is

> Do remember when setting your timeout, that you have to set it in both 
> connections.


Kees Nuyt
sqlite-users mailing list

Reply via email to