Re: [sqlite] Read-only access which does not block writers

2016-11-24 Thread Florian Weimer
On 11/24/2016 10:41 PM, Howard Chu wrote: Florian Weimer wrote: On 11/24/2016 02:54 PM, Richard Hipp wrote: On 11/24/16, Florian Weimer wrote: I'd like to replace the use of Berkeley DB in RPM with SQLite. The scenario is special in the follow way. There is no database

Re: [sqlite] Read-only access which does not block writers

2016-11-24 Thread Florian Weimer
On 11/24/2016 02:54 PM, Richard Hipp wrote: On 11/24/16, Florian Weimer wrote: I'd like to replace the use of Berkeley DB in RPM with SQLite. The scenario is special in the follow way. There is no database server, all access goes directly to the database. Unprivileged

Re: [sqlite] Read-only access which does not block writers

2016-11-24 Thread Paul Sanderson
Could you use PRAGMA data_version before and after each read to see whether there have been any changes to the DB - not surehow this works in WAL mode? Paul www.sandersonforensics.com skype: r3scue193 twitter: @sandersonforens Tel +44 (0)1326 572786

Re: [sqlite] Read-only access which does not block writers

2016-11-24 Thread Howard Chu
Florian Weimer wrote: On 11/24/2016 02:54 PM, Richard Hipp wrote: On 11/24/16, Florian Weimer wrote: I'd like to replace the use of Berkeley DB in RPM with SQLite. The scenario is special in the follow way. There is no database server, all access goes directly to the

Re: [sqlite] Read-only access which does not block writers

2016-11-24 Thread Howard Chu
Florian Weimer wrote: On 11/24/2016 10:41 PM, Howard Chu wrote: As a compromise you could use SQLightning, which replaces SQLite's Btree layer with LMDB. Since LMDB *does* allow readers that don't block writers. How does it do that? Does LMDB perform lock-free optimistic reads and

Re: [sqlite] Read-only access which does not block writers

2016-11-24 Thread Simon Slavin
On 24 Nov 2016, at 11:02am, Florian Weimer wrote: > The scenario is special in the follow way. There is no database server, all > access goes directly to the database. Unprivileged users without write > access to the RPM database are expected to run read-only queries

[sqlite] Read-only access which does not block writers

2016-11-24 Thread Florian Weimer
I'd like to replace the use of Berkeley DB in RPM with SQLite. The scenario is special in the follow way. There is no database server, all access goes directly to the database. Unprivileged users without write access to the RPM database are expected to run read-only queries against the

Re: [sqlite] Read-only access which does not block writers

2016-11-24 Thread Paul Sanderson
Steps 2 and 3 can be swapped Also you can convert an existing database from one mode to another (although not, I suspect (I have not tried), in the middle of a transaction and if in the DB is wal mode and you are changing to journal then this would force a checkpoint). Paul

Re: [sqlite] Read-only access which does not block writers

2016-11-24 Thread Eduardo Morras
On Thu, 24 Nov 2016 08:54:47 -0500 Richard Hipp wrote: > On 11/24/16, Florian Weimer wrote: > > I'd like to replace the use of Berkeley DB in RPM with SQLite. > > > > The scenario is special in the follow way. There is no database > > server, all access

Re: [sqlite] Read-only access which does not block writers

2016-11-24 Thread Florian Weimer
On 11/24/2016 01:10 PM, Simon Slavin wrote: On 24 Nov 2016, at 11:02am, Florian Weimer wrote: The scenario is special in the follow way. There is no database server, all access goes directly to the database. Unprivileged users without write access to the RPM database

Re: [sqlite] Read-only access which does not block writers

2016-11-24 Thread Simon Slavin
On 24 Nov 2016, at 1:41pm, Florian Weimer wrote: > Item 5 says: > > “ > It is not possible to open read-only WAL databases. The opening process must > have write privileges for "-shm" wal-index shared memory file associated with > the database, if that file exists, or

Re: [sqlite] Read-only access which does not block writers

2016-11-24 Thread Richard Hipp
On 11/24/16, Florian Weimer wrote: > I'd like to replace the use of Berkeley DB in RPM with SQLite. > > The scenario is special in the follow way. There is no database server, > all access goes directly to the database. Unprivileged users without > write access to the RPM