Repository navigation
roll back the transaction when its commit fails; update to sqlite-simple 0.4.19.0 - #2
Open
evgeny-simplex wants to merge 12 commits into
Open
evgeny-simplex wants to merge 12 commits into
evgeny-simplex wants to merge 12 commits into
Conversation
* rename to sqlcipher-simple, use direct-sqlcipher * cabal.project * update direct-sqlcipher * use local direct-sqlcipher * use direct-sqlcipher from git * update direct-sqlcipher commit
epoberezkin
marked this pull request as ready for review
November 19, 2026 21:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem. The transaction functions roll back when the action throws, but not when COMMIT or RELEASE throws. A COMMIT that fails with SQLITE_BUSY keeps the transaction active (https://sqlite.org/lang_transaction.html), so every later BEGIN on the connection fails with "cannot start a transaction within a transaction".
Fix (Database/SQLite/Simple.hs):
withSavepointruns aswithTransaction(ROLLBACK TO does not end a transaction, https://sqlite.org/lang_savepoint.html).Upstream update to nurpax/sqlite-simple master 2b7b708 (0.4.19.0), reviewed against simplexmq and simplex-chat:
MonadThrow Okkeeps the exception (unused by SimpleX), date errors include the field text, docs and tests;SimpleX no longer calls these transaction functions after simplex-chat/simplexmq#2084; this keeps the library correct and is the basis of a pull request to nurpax/sqlite-simple.
Merge with a merge commit, not a squash, to keep nurpax master in the history for the next upstream update.