Re: [sqlite] SQLite 3 locking

2017-03-02 Thread Rowan Worth
On 1 March 2017 at 02:39, Matthew Ceroni wrote: > > So since busy_timeout defaults to 0, all write attempts if a lock can't be > obtained will return SQLITE_BUSY immediately. Where does the PENDING lock > come into play here? I thought the PENDING was meant to be an intermediary > step before EXC

Re: [sqlite] SQLite 3 locking

2017-02-28 Thread Domingo Alvarez Duarte
Hello ! On this snippet you can play with the parameters and find a value that can give a good result for a workload: https://gist.github.com/mingodad/79225c88f8dce0f174f5 I did it to test sqlite3 wall mode but it also work without it and with disk/memory databases. Cheers ! On 28/02/17

Re: [sqlite] SQLite 3 locking

2017-02-28 Thread Matthew Ceroni
Appreciate it. Have a much better picture now. Thanks On Feb 28, 2017 4:48 PM, "Simon Slavin" wrote: > > On 1 Mar 2017, at 12:40am, Matthew Ceroni wrote: > > > Once PENDING is obtained, what time out value controls how long to wait > to > > get EXCLUSIVE? > > There is only the one timeout valu

Re: [sqlite] SQLite 3 locking

2017-02-28 Thread Simon Slavin
On 1 Mar 2017, at 12:40am, Matthew Ceroni wrote: > Once PENDING is obtained, what time out value controls how long to wait to > get EXCLUSIVE? There is only the one timeout value for each connection: the one you set. Each attempt to escalate the lock level can take up to the timeout value bef

Re: [sqlite] SQLite 3 locking

2017-02-28 Thread Matthew Ceroni
Once PENDING is obtained, what time out value controls how long to wait to get EXCLUSIVE? On Feb 28, 2017 4:33 PM, "Simon Slavin" wrote: > > On 1 Mar 2017, at 12:29am, Matthew Ceroni wrote: > > > Appreciate the reply. I just found it odd that busy_timeout is set to 0 > (so > > fail immediately)

Re: [sqlite] SQLite 3 locking

2017-02-28 Thread Simon Slavin
On 1 Mar 2017, at 12:29am, Matthew Ceroni wrote: > Appreciate the reply. I just found it odd that busy_timeout is set to 0 (so > fail immediately) considering the intermediary PENDING stage. That stage is > essentially useless with the default busy timeout of 0 no? Only if its first attempt at

Re: [sqlite] SQLite 3 locking

2017-02-28 Thread Matthew Ceroni
Appreciate the reply. I just found it odd that busy_timeout is set to 0 (so fail immediately) considering the intermediary PENDING stage. That stage is essentially useless with the default busy timeout of 0 no? I will read up on WAL. On Tue, Feb 28, 2017 at 4:22 PM, Simon Slavin wrote: > > On 2

Re: [sqlite] SQLite 3 locking

2017-02-28 Thread Simon Slavin
On 28 Feb 2017, at 6:39pm, Matthew Ceroni wrote: > After a bit of reading and troubleshooting I stumbled across the > busy_timeout option (which defaults to 0). Prior to execute the create > table statement I set PRAGMA busy_timeout=1000 (1 s) and the writes always > succeeded. You need to set