0 votes
1 view
in SQL by (6.1k points)

I have been doing some repetitive processes in my application (testing it), and suddenly I’m receiving a weird error:

OperationalError: database is locked

I have restarted the server as well, but still, the error persists.

What is it all about?

1 Answer

0 votes
by (12.7k points)
edited by

The practical reason for this is usually that the python or django shells have opened a request to the DB and it has not been closed properly; killing your terminal access usually frees it up. I am getting this error on running command line tests today.

If you want to kill access without rebooting the terminal, then from commandline you can do:

from django import db
db.connections.close_all()

Interested in SQL ? Check out this SQL Certification course by Intellipaat.

Related questions

0 votes
1 answer
asked Dec 12, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !

Categories

...