[sqlite] WAL: difference between IMMEDIATE and DEFERRED transaction

2016-01-18 Thread Rowan Worth
On 15 January 2016 at 22:09, Olivier Vidal wrote: > For the DEFERRED transaction: > > - BEGIN DEFERRED TRANSACTION > - SELECT > - UPDATE > - SELECT > - UPDATE > - INSERT > - SELECT > - COMMIT > > The lock is requested at the first UPDATE (and there have no TIMEOUT?). > The database cannot be

[sqlite] WAL: difference between IMMEDIATE and DEFERRED transaction

2016-01-15 Thread Olivier Vidal
Than you Mr Hipp! So DEFERRED advantage is that less time locked (if there are SELECTS between BEGIN and UPDATE). But its drawback is that other threads can write between BEGIN and the first UPDATE / DELETE .. ? > Richard Hipp > vendredi 15 janvier 2016 15:19 > >

[sqlite] WAL: difference between IMMEDIATE and DEFERRED transaction

2016-01-15 Thread Olivier Vidal
Hello all, I would like to be sure I understand the difference between an IMMEDIATE transaction and a DEFERRED transaction, in WAL mode. Sorry for my bad english. Here is what I understand: Example of an IMMEDIATE transaction: - BEGIN IMMEDIATE TRANSACTION - SELECT - UPDATE - SELECT - UPDATE

[sqlite] WAL: difference between IMMEDIATE and DEFERRED transaction

2016-01-15 Thread Richard Hipp
On 1/15/16, Olivier Vidal wrote: > > Hello all, > > I would like to be sure I understand the difference between an IMMEDIATE > transaction and a DEFERRED transaction, in WAL mode. BEGIN IMMEDIATE claims a write lock on the database file immediately, so that no other process or thread can come