[sqlite] Feature Suggestions

2015-09-25 Thread Simon Slavin
On 25 Sep 2015, at 2:39am, Allen wrote: > I wanted > to confirm the readers would work correctly while another connection > held an EXCLUSIVE lock, because if they didn't, and the lock > eventually went EXCLUSIVE automatically, that might be a problem, Don't forget to have each connection set a

[sqlite] Feature Suggestions

2015-09-25 Thread Allen
> Don't forget to have each connection set a timeout This makes SQLite > automatically retry (using monotonic backoff) if the database is locked. I had that set to 10 seconds using sqlite3_busy_timeout(db, 1). That doesn't work in shared cache mode--in that mode, you immediately get an SQ

[sqlite] Feature Suggestions

2015-09-25 Thread Simon Slavin
On 25 Sep 2015, at 1:27am, Allen wrote: >> Why on earth are you using BEGIN EXCLUSIVE? > > If WAL works "as advertised", I might as well go straight to EXCLUSIVE so I > don't have to later escalate the lock from RESERVED to EXCLUSIVE. And it > does work just fine, once I turned off the shared

[sqlite] Feature Suggestions

2015-09-24 Thread Allen
> The problem with going to EXCLUSIVE manually is that you lock out other > connections for longer than necessary. I have only one connection that does writes. In any event, I wanted to confirm the readers would work correctly while another connection held an EXCLUSIVE lock, because if they didn

[sqlite] Feature Suggestions

2015-09-24 Thread Allen
> Why on earth are you using BEGIN EXCLUSIVE? If WAL works "as advertised", I might as well go straight to EXCLUSIVE so I don't have to later escalate the lock from RESERVED to EXCLUSIVE. And it does work just fine, once I turned off the shared cache mode.

[sqlite] Feature Suggestions

2015-09-24 Thread Allen
> I was under the apparently mistaken impression that starting any transaction would block writes, even in WAL mode. My problem was that I was using sqlite3_enable_shared_cache(true). I enabled this because I was under the impression that is required for multiple connections to share an in-memory

[sqlite] Feature Suggestions

2015-09-24 Thread Simon Slavin
On 24 Sep 2015, at 5:37pm, Allen wrote: > I was under the apparently mistaken impression that starting any > transaction would block writes, even in WAL mode. In WAL mode, a writing connection writes to the journal. Other connections will continue to read from the 'live' database. When the w

[sqlite] Feature Suggestions

2015-09-24 Thread Clemens Ladisch
Allen wrote: > 1. It would be nice to have read-only transactions for use with WAL > databases. When a read-only transaction was started, it would take a > "lock" on the WAL and then not advance further into the WAL until the > transaction ended. Thus, all select statements issued while the read

[sqlite] Feature Suggestions

2015-09-24 Thread Keith Medcalf
> > WAL does this already. You just need to BEGIN a transaction when you > want it to BEGIN and COMMIT or ROLLBACK when you are done with it. > > I was under the apparently mistaken impression that starting any > transaction would block writes, even in WAL mode. > > Just to be clear, this would

[sqlite] Feature Suggestions

2015-09-24 Thread Allen
> WAL does this already. You just need to BEGIN a transaction when you want it to BEGIN and COMMIT or ROLLBACK when you are done with it. I was under the apparently mistaken impression that starting any transaction would block writes, even in WAL mode. Just to be clear, this would work: On mult

[sqlite] Feature Suggestions

2015-09-24 Thread Allen
Suggestions for SQLite features: 1. It would be nice to have read-only transactions for use with WAL databases. When a read-only transaction was started, it would take a "lock" on the WAL and then not advance further into the WAL until the transaction ended. Thus, all select statements issued wh

[sqlite] Feature Suggestions

2015-09-24 Thread Keith Medcalf
On Thursday, 24 September, 2015 08:53, Allen said: > Suggestions for SQLite features: > 1. It would be nice to have read-only transactions for use with WAL > databases. When a read-only transaction was started, it would take a > "lock" on the WAL and then not advance further into the WAL until