On Sat, 19 Jan 2019 08:07:42 -0500
Richard Hipp <[email protected]> wrote:
> The busy timeout is not working because you start out your transaction
> using a read operation - the first SELECT statement - which gets a
> read lock. Later when you go to COMMIT, this has to elevate to a
> write lock. But SQLite sees that some other process has already
> updated the database since you started your read.
Another solution is to rely on atomicity in SQL:
insert into t
select :pid, nrows, N
from (select 1 as N union select 2 union select 3) as cardinals
cross join (select :pid, count(*) as nrows from t) as how_many;
By using a single SQL statement, you avoid a user-defined transaction
and any proprietary transaction qualifiers.
--jkl
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users