Repository navigation
fix(jdbc): propagate rollback failures and keep transaction state - #58
Merged
Merged
Conversation
magnusp
force-pushed
the
fix/30-rollback-failures
branch
2 times, most recently
from
October 21, 2026 21:45
087a5d9 to
2c38e54
Compare
Share commit and rollback error handling, throw SQLException when the server rejects the transaction command, and keep the baton so callers can retry without losing transaction state.
magnusp
force-pushed
the
fix/30-rollback-failures
branch
from
October 21, 2026 21:51
2c38e54 to
e1abd18
Compare
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.
Closes #30. Part of #54.
What changed
commit()androllback()now delegate to one sharedendTransactionpath, matching xerial 3.53.4.0SQLiteConnection.java:435-451.StreamResult.ErrorfromCOMMIT/ROLLBACK, or a transportLibsqlException, is mapped toSQLExceptioninstead of being ignored.LibsqlConnectionTestcovering server and transport failures for bothCOMMITandROLLBACK.rollback(), asserts theSQLException, reconnects, retries the rollback, and verifies the insert was rolled back.Contract decision
Parity with xerial 3.53.4.0: commit and rollback share one error path, a failed
ROLLBACKthrows, and transaction state is not cleared on failure.Deviations
Transport-only:
COMMIT/ROLLBACKis sent as its own pipeline request, and the streamCloseis sent only after a successful transaction command. SendingExecute+Closein one pipeline would close the Hrana stream even when the command failed, so the driver could not preserve transaction state for a retry. The observable JDBC behavior matches xerial; the extra request is forced by the Hrana stream model.Evidence
Failing before the fix (old
LibsqlConnection):Live failing before the fix (old driver installed, Toxiproxy run):
Passing after the fix:
DOCKER_CONFIG=/tmp/docker-configuses an empty public-image auth file because the sandbox blocks~/.docker/config.json(AGENTS.md section 4). It does not change test behavior.Out-of-scope defects
None newly found. The re-BEGIN-after-commit/rollback lifecycle gap is already tracked by #40.