Trying to simply update existing row in database (running on web2py),
but always getting database locked error..
<class 'sqlite3.OperationalError'> database is locked
db = DAL('sqlite://storage.sqlite',pool_size=10,auto_import=True)
# get first record
record = db(db.mytest).select().first()
# try to update it.. database locked error here
# just in case needed?
Check Whether there is no other connection (to sqlite db) open on your machine, if web2py shell is open, close it.
Check DAL is defined only once or not. Define DAL only in
models/db.py, no need to define it again in controller.
Every variable defined in models is visible in controllers.
You must have defined
models/db.py and you are defining once again in controller, so you have two connection open for
SQLite db. Thats why you are getting error '
database is locked'.