On 8/4/17, Luc DAVID <lucdavid....@free.fr> wrote:
> Hello,
>
> I was thinking about a possible solution for sqlite "only single writer
> is allowed at the same time" and database lock.
>
> sqlite has WAL mode for better concurrency and this could maybe be used
> to extend the number of writters:

The begin-concurrent branch
(https://sqlite.org/src/timeline?r=begin-concurrent&n=all) allows you
to say:

     BEGIN CONCURRENT;
     -- various database reads and updates
     COMMIT;

And to do that simultaneously in two or more database connections, and
have them all work.  Except, the concurrent transactions may not
overlap.  That is to say, content written by one may not be read or
written by another.  If the transactions do overlap, the second one to
try to COMMIT will get an SQLITE_BUSY_SNAPSHOT error and will be
forced to abandon its transaction and start over.

The begin-concurrent branch is in production use in high-stress
environments.  We have not merged that branch to trunk (yet) because
it currently imposes extra overhead on all applications, even
applications that do not use BEGIN CONCURRENT.

Another alternative is the newer server-process-edition branch
(https://sqlite.org/src/timeline?n=all&r=server-process-edition) which
you can read about here:
https://sqlite.org/src/artifact/0c6bc6f55191b690

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

Reply via email to