SQLite Forum

Nesting of statements
Login
SQLite3 does not support the "FOR UPDATE OF column-list ON table" so you should not be performing UPDATEs interleaved on the same connection as you are using for the SELECT since isolation only exists between *connections* and not between *statements*.

You *should* either be using separate connections (so that isolation is maintained) **OR** you should be executing the **entire** select and collecting the necessary data **BEFORE** performing the UPDATE as **part of the same transaction on the same connection**.  You also need to ensure that you maintain proper stability during the process.

Interleaving the row fetching from a SELECT with concomitant UPDATE involving common tables in both is fraught with peril.

The proper solution is to not do that.