On Tuesday, 30 July, 2019 14:43, Simon Slavin <slav...@bigfraud.org> wrote:

>On 30 Jul 2019, at 9:39pm, test user <example.com.use...@gmail.com> wrote:

>> BEGIN IMMEDIATE will start a write transaction, which will block
>> other writers with SQLITE_BUSY until its complete.

> This does not apply to WAL mode.  You wrote that you were using WAL
> mode.

You are incorrect Simon.  BEGIN IMMEDIATE indicates that the transaction 
started on the connection will update the database by acquiring an intent 
(write) lock immediately.  No other connection will be able to obtain an intent 
(write) lock on the database -- it does not matter whether the journal mode is 
write-ahead or rollback (write-behind).  Other connections (in 
write-ahead-logging mode only) will be able to obtain SHARED (read) locks, but 
will not be able to obtain intent (write) locks.

Using BEGIN IMMEDIATE to obtain locks for read-only transactions will 
effectively eliminate all concurrent access to the database.

>> What I would like is something like BEGIN READ

>The statement 'BEGIN READ' does not exist in SQlite.

I think that is the point.  There is no way to immediately acquire a shared 
lock on the database.

-- 
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.




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

Reply via email to