You should not close the connection from one thread while another thread is using it. I don't know what will happen under all circumstances but 'undocumented' and 'unpredictable' come to mind. You didn't mention this function, which seems to be ideal: https://www.sqlite.org/c3ref/interrupt.html It definitely should terminate long-running single statements (e.g. UPDATE working on millions of rows), because it works at a lower level than a single statement. If it doesn't do what you want, please ask again.