I have written the following code, which is showing the sqlite3.OperationalError: database is locked error. Any help to debug would be much appreciated.
I had the same issue but it was resolved when I used the following to close the concurrent connections.
conn.close()
So, if your program begins like this:
import sqlite3
conn = sqlite3.connect('pg_example.db', timeout=10)
c = conn.cursor()
Make sure that you're including the conn.close() after each SQL statement
t = ('RHAT',)
c.execute('SELECT * FROM stocks WHERE symbol=?', t)
conn.commit()
conn.close() #This is the one you need