[web2py] Re: sqlite3 locking

2015-07-29 Thread Niphlod
db.py is usually a model, so it gets executed once per request. Enabling WAL is a thing needed just one time only (that "setting" gets stored in the sqlite database file). When you "reopen" the file WAL is already been activated. There is no other activity involved once the database file has bee

[web2py] Re: sqlite3 locking

2015-07-29 Thread jackson . read
thats once per database I assume. Can I put it in db.py to have it executed once? On Friday, July 24, 2015 at 4:52:26 PM UTC-4, jackso...@quantachrome.com wrote: > > The docs say that web2py locks a sqlite3 database file always...even if > just reading. Is there a way to circumvent this so that

[web2py] Re: sqlite3 locking

2015-07-29 Thread Niphlod
to alleviate the issues, recent sqlite builds feature a mode to activate that is called "WAL" , which you can read about at https://www.sqlite.org/wal.html . you can enable it just executing PRAGMA journal_mode=WAL once in the database . if you want to do it in web2py, run this code just once d

[web2py] Re: sqlite3 locking

2015-07-27 Thread jackson . read
In the web2py book chap 29: "Notice that in SQLite the database consists of a single file. If it does not exist, it is created. This file is locked every time it is accessed." I assume access meant reading or writing the database On Friday, July 24, 2015 at 4:52:26 PM UTC-4, jackso...@quantac

[web2py] Re: sqlite3 locking

2015-07-24 Thread Massimo Di Pierro
Where do we say that? We do not lock it for reading. But if it is locked for writing it cannot be opened for reading, this is default sqlite behavior. Web2py does not do anything special to change it. On Friday, 24 July 2015 15:52:26 UTC-5, jackson.r...@quantachrome.com wrote: > > The docs say t