0

Often happens that I debug a python application connecting to sqlite database and during debugging the connection is not closed.

When I debug it next time, the database is locked, so I can't connect to it so I have to edit source code, close connection before the place where exception database is locked occur, comment the source code and continue debugging.

Is it possible to unlock the database faster? For example from command line?

thank you

2
  • 2
    Why not track down the root of the problem and ensure that the database connection is closed properly before exit? Commented Oct 19, 2011 at 20:33
  • @DemianBrecht How would you do it when you interrupt the application while debugging before the connection could be closed? Commented Oct 24, 2011 at 12:31

1 Answer 1

1

The database is locked to other connections when a transaction is in progress. You can find documentation about SQLite locking here.

However you can still access the database via the connection that has locked it. You can stick that in a global variable or something similar while debugging.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.