If the user navigates away from a page whilst a database transaction is in progress, the database lock is never released and subsequent accesses to that database fail.
This is what I think is happening:
- The transaction starts.
- Whilst the transaction is still executing, the user reloads the page.
- In the document::stopAllDatabases method, the database is stopped and the database thread asked to die.
- The page reloads.
- The transaction eventually finishes executing and schedules it's next step in the database thread. However the database thread was asked to die, and so is about to complete, which means the next transaction step is never executed and so the transaction is never committed or rolled back. So, the lock on the database file is never released.
I have a patch to fix and a layout test to verify in the works, should be ready soon.
Created attachment 30343 [details]
This patch fixes the bug by setting a busy handler for database transactions and running the error steps synchronously should the database the transaction was running on be stopped whilst it is running. The busy handler is needed to make transactions on the new page wait for the old transaction to complete and roll back before running.
*** This bug has been marked as a duplicate of 25711 ***