Re: [sqlite] Concurrency support for multiple process

2010-01-28 Thread Max Vlasov
> I expect process B able to > read the old data and displays appropriately. But, process B seems to be > blocked. Why is this so as I thought SQLite handle concurrency as in this > case where there are multiple reads and one single write ? > After Pavel's explanation just reread http://www.s

Re: [sqlite] Concurrency support for multiple process

2010-01-28 Thread Pavel Ivanov
It's not clear what locks did you want to show with your diagram but in reality locks would be held as following: *Process A*: Begin Transaction - no lock *Process B*: Select DB1 <-- shared lock *Process A*: Insert DB1 <-- if insert is small then only reserved lock *Process B*: Select DB1 <-- sha

Re: [sqlite] Concurrency support for multiple process

2010-01-28 Thread nyetngoh wong
Hi, Is the locking states shown below for DB1 correct ? *Process A* *Process B* Begin Transaction Insert DB1<-- Reserved lock Select DB1<-- Shared lock Insert DB1 : after 10 Inserts and 10 Selects Select DB1<-- Shared lock : Continue Inserts and

Re: [sqlite] Concurrency support for multiple process

2010-01-28 Thread Max Vlasov
> > > SQLite allows multiple readers OR a single writer to access the database > simultaneously. > From the SQLite doc, as long as no transaction is pending, other process > can > read or obtain reserved lock for write. > the docs say: "Locks are not acquired until the first read or write operatio

Re: [sqlite] Concurrency support for multiple process

2010-01-27 Thread nyetngoh wong
> What made you expect that? Process A has not entered the exclusive lock and so process B can obtain shared lock to read. > SQLite allows multiple readers OR a single writer to access the database simultaneously. >From the SQLite doc, as long as no transaction is pending, other process can read o

Re: [sqlite] Concurrency support for multiple process

2010-01-27 Thread Igor Tandetnik
nyetngoh wong wrote: > First, I've a process A that do many inserts to the database and reads back > from the database to verify. The writes are done in one DEFERRED transaction > as data are not committed yet. While the first process running, another > process B is launched to read from the databa

[sqlite] Concurrency support for multiple process

2010-01-27 Thread nyetngoh wong
Hi, First, I've a process A that do many inserts to the database and reads back from the database to verify. The writes are done in one DEFERRED transaction as data are not committed yet. While the first process running, another process B is launched to read from the database for display purposes.