Repository navigation
docs: rewrite the transaction contract for lazy begin and mapped errors (#78) - #152
Merged
Merged
Conversation
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.
Fixes #78
Three-layer contract. Hrana 3 over HTTP supplies the stream/baton transport: a begin is a request with a null baton, commit and rollback close their stream, and the server expires idle streams.
java.sqlsupplies the JDBC lifecycle (auto-commit flag, commit/rollback rules, exception typing). xerial sqlite-jdbc is the behavioral reference for the transaction mode names and the no-op commit/rollback with no work.Red
At
origin/main(c496e38), section 2 still claims read-write transactions issueBEGIN IMMEDIATEeagerly at the start of the transaction pipeline. That is the contract #99 removed. Evidence:/tmp/xerial-parity-i78/lane-1-regression.log(trunk half contains the stale claim; head half does not).Green
Section 2 now documents the implemented contract of
LibsqlConnectionafter #99, #108, and #109:setAutoCommit(false)sends nothing; the next statement begins on a new stream;TransactionMode.DEFERRED(default),IMMEDIATE, orEXCLUSIVE, set withLibsqlConnection.setTransactionMode;executeStatement,executeBatchResults,beginTransaction, andendTransaction, with theBatchUpdateExceptionwrapping;The #83 section now states that the transaction begins lazily on the first statement.
Lanes
/tmp/xerial-parity-i78/lane-1-regression.logLibsqlConnectionbeginPending(),beginTransaction(), andTransactionMode; matches./tmp/xerial-parity-i78/lane-2-specific.logLibsqlTransactionLifecycleITidle cases; the remaining open-transaction expiry limit is documented./tmp/xerial-parity-i78/lane-4-commands.log/tmp/xerial-parity-i78/lane-5-refs.log/tmp/xerial-parity-i78/lane-6-diff.log/tmp/xerial-parity-i78/lane-7-render.log./mvnw -q validateexits 0./tmp/xerial-parity-i78/lane-8-validate.loggrep -n 'BEGIN' IMPLEMENTATION_BUGS_AND_RESOLUTIONS.mdand a claim-by-claim read againstLibsqlConnection../mvnw -pl libsql-jdbc testthree runs interleaved atc496e38andd00127d; trunk median 2.13 s, head median 2.13 s (/tmp/xerial-parity-i78/perf-times.log). Docs-only, so no code delta.Divergences and extra edits
Transaction Lifecycle over Hrana (Lazy Begin and WAL Locks)because the section now covers the whole transaction contract, not only WAL upgrades; the ToC anchor is updated.HranaHttpClient.javatoLibsqlHttpClient.java, andHranaJsonCodec.javatoDirectHranaJsonCodec.java.Base:
c496e38. Head:d00127d.