> my condition is a simple stand-alone application that does not share the database with other applications What SQLite cares about is that there are multiple connections. > Is there a way to configure sqlite to always call my busy-handler callback? And what would your busy handler do? In case of a deadlock, waiting would not help. > I found that when using IMMEDIATE transaction my callback is being called and all seems to work, but I am not sure on how solid this solution is A deadlock happens when two read-only transactions want to upgrade to read/write. BEGIN IMMEDIATE starts the transaction as read/write.