[Python] Why did `touch <name of database>.db` fix the lock error on my database?

Discussão em 'Python' iniciado por Stack, Maio 2, 2025.

  1. Stack

    Stack Membro Participativo

    My python script kept returning a Database is locked error when trying to access an SQLite database. I noticed the timestamp on the database was not updating when I would manually enter into the database and read/insert stuff.

    When I ran touch <name of database>.db the timestamp updated. So I retried the python script everything worked as it should.

    I'm happy it worked; however, I want to know why it worked. What additional things happen with the touch command other than updating the timestamp? Permissions were all preserved. Thanks for the input!

    Continue reading...

Compartilhe esta Página