Re: [sqlite] When is data committed on one connection seen on another?

2016-09-13 Thread Simon Slavin
On 13 Sep 2016, at 9:00pm, Alex Ward wrote: > What is the standard idiom to avoid stale data while still allowing all but a > writing thread not to see uncommitted data? You should not need to do anything special to arrange this. > Is there a window of time between a commit

Re: [sqlite] Result code 5 from sqlite3_prepare_v2() in WAL mode?

2016-09-13 Thread Richard Hipp
On 9/13/16, Eric Sink wrote: > Excellent. Thanks. Thanks for pointing out the issue. I have attempted to improve the documentation here: https://www.sqlite.org/wal.html#busy Further improvements may be forthcoming. -- D. Richard Hipp d...@sqlite.org

Re: [sqlite] When is data committed on one connection seen on another?

2016-09-13 Thread Igor Tandetnik
On 9/13/2016 4:00 PM, Alex Ward wrote: We think we are seeing the case where a read on one WAL mode Sqlite database connection using the C API is reading stale data after a transaction has committed data changes on another connection. For instance, a deleted row on one connection is still

Re: [sqlite] Result code 5 from sqlite3_prepare_v2() in WAL mode?

2016-09-13 Thread Eric Sink
Excellent. Thanks. -- E On Tue, Sep 13, 2016 at 3:05 PM, Richard Hipp wrote: > On 9/13/16, Eric Sink wrote: > > > > I can fit this into your explanation: > > > > "Another process might have opened the same database with > > locking_mode=EXCLUSIVE" > > >

Re: [sqlite] Result code 5 from sqlite3_prepare_v2() in WAL mode?

2016-09-13 Thread Richard Hipp
On 9/13/16, Eric Sink wrote: > > I can fit this into your explanation: > > "Another process might have opened the same database with > locking_mode=EXCLUSIVE" > > if I change the word "process" to "thread", and if I assume that > sqlite3_open_v2() on a WAL-mode file can

[sqlite] When is data committed on one connection seen on another?

2016-09-13 Thread Alex Ward
We think we are seeing the case where a read on one WAL mode Sqlite database connection using the C API is reading stale data after a transaction has committed data changes on another connection. For instance, a deleted row on one connection is still found by a select on the other. The

Re: [sqlite] Result code 5 from sqlite3_prepare_v2() in WAL mode?

2016-09-13 Thread Eric Sink
The app had several threads that were frequently doing this: open the sqlite file do something close it When I changed it to stop opening the file so much and re-use the connections, the problem went away. I can fit this into your explanation: "Another process might have opened the same

Re: [sqlite] Result code 5 from sqlite3_prepare_v2() in WAL mode?

2016-09-13 Thread Eric Sink
This is happening in an Android app. No other process is involved, but the filesystem there is weird, so I'm focusing on the third possibility you mentioned. Thanks, -- E On Mon, Sep 12, 2016 at 7:52 PM, Richard Hipp wrote: > On 9/12/16, Eric Sink

Re: [sqlite] page_size: bug with PRAGMA or documentation?

2016-09-13 Thread Rowan Worth
Thanks Richard, that's much clearer. Just one thing: "The page_size pragma will only set in the page size if ..." The "in" looks out of place :) -Rowan On 12 September 2016 at 19:43, Richard Hipp wrote: > On 9/12/16, Rowan Worth wrote: > > The docs for