How do i stop the The database file is locked exception?
问题 I have a multithreaded app that uses sqlite. When two threads try to update the db at once i get the exception Additional information: The database file is locked I thought it would retry in a few milliseconds. My querys arent complex. The most complex one (which happens frequently) is update, select, run trivial code update/delete, commit. Why does it throw the exception? How can i make it retry a few times before throwing an exception? 回答1: SQLite isn't thread safe for access, which is why