Skip to content

fix(android): handle transactions correctly on failed calls, upgrades and close - #705

Open
robingenz wants to merge 1 commit into
masterfrom
fix/android-transactions
Open

robingenz wants to merge 1 commit into
masterfrom
fix/android-transactions

Conversation

@robingenz

Copy link
Copy Markdown
Member

What changed

  • A call with transaction: true that fails because a transaction is already open no longer rolls back that transaction. Before, the rows of the open transaction were lost without an error.
  • open() now works when an upgrade statement is a DELETE ... WHERE. Before, it failed with "Database not opened".
  • close() now ends a transaction that is still open, so the next connection no longer gets "database is locked (code 5)". This covers a close on the same thread, for example after a page reload.

How it was tested

Instrumented tests on an emulator with the real SQLCipher library. Each of the three cases fails on the old code and passes with this change.

Close #700
Close #665
Close #659

🤖 Generated with Claude Code

… and close

A failed call no longer rolls back a transaction it did not open. open() sets the open state before the upgrade, so DELETE statements work there. close() ends a transaction that is still open, so the file is not left locked.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant