SQLite Forum

How to circumvent "apsw.BusyError: BusyError: database is locked"?
Login
Now, I have multiple write processes using `BEGIN IMMEDIATE`. Then, I access the db for reading only using the following code.

```
import apsw
conn = apsw.Connection(f, flags = apsw.SQLITE_OPEN_READONLY)
c = conn.cursor()
c.execute('pragma busy_timeout=5000;')
try:
	for x in c.execute('SELECT name FROM sqlar'):
		print(x[0])
except:
	print(sys.argv[1] % ("Failed to process '%s'." % f), file=sys.stderr)
	raise
```

I still get the same error.

```
apsw.BusyError: BusyError: database is locked
```

Do you know how to fix the problem?