Skip to content

Docs: a Transactions page, with tests that pin each statement first - #279

Merged
tae898 merged 1 commit into
mainfrom
docs/267-results-transactions
Nov 6, 2026
Merged

tae898 merged 1 commit into
mainfrom
docs/267-results-transactions

Conversation

@tae898

@tae898 tae898 commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

First slice of #267 (audit of the docs against 26.11.1), draft. It covers row 2, transactions, and records that row 1, single-pass results, was already done.

Tests first: tests/test_transactions_behavior.py pins commit, rollback, the context manager, an exception inside it, a failed statement inside a transaction (the 26.11.1 undo), a second begin(), what the transaction and another thread see before the commit, set_auto_transaction, the run_in_transaction defaults and the GraphBatch refusal. The new page how-to/transactions.adoc says only what those tests prove, and tests/test_docs_transactions_page.py runs every Python block of the page on both backends, in the pattern of the vectors page. The page is in the nav and linked from the quickstart, Databases and queries, Concurrency and Bulk loads (an explicit [[threads]] anchor was added to Concurrency for the link). It follows the DSL-first rule (statements through db.command and db.query) and links the main manual for what the engine guarantees.

I could not run the tests on the laptop (CI runs them), so every assertion comes from reading the engine source (LocalDatabase.begin/commit/rollback, TransactionContext statement savepoints, the engine's own Issue10194 test) and the bindings code. If a test fails in CI, the page statement it backs is wrong and gets fixed here.

Behavior worth a look, none of it filed:

  • with db.transaction(): ...; db.commit() raises ArcadeDBError ("Transaction not begun") at the end of the block, because the context manager commits again. The rows of the first commit stay.
  • db.rollback() with no active transaction raises nothing, while db.commit() with none raises.
  • A second begin() opens a nested transaction that is independent of the outer one: it does not see the outer's uncommitted rows, and its commit is durable even if the outer one rolls back. with db.transaction() inside another with does the same, so nesting is not a savepoint.
  • The refused commit above arcadedb.txStatementSavepointMaxEntries is stated from the engine's setting description and is not covered by a test here.

Left of #267: rows 3 (types and datetimes), 4 (import and export), 5 (DataFrame, Arrow and columns), 8 (Python functions and events), 9 (record objects), 10 (set_wal_flush, fileSync, txWalGroupCommit), 11 (AsyncExecutor) and 12 (the Schema API line). Rows 6, 7 and 13 and the stale statements were planned for #264 (merged) and #276; I did not re-check them against main here, so that is still to confirm. Row 1 I did check: the section "A result set is read once" is on Databases and queries since #264, and tests/test_resultset.py already pins it.

Refs #267

🤖 Generated with Claude Code

…refs #267)

Row 2 of the 26.11.1 docs audit. tests/test_transactions_behavior.py pins commit, rollback,
the context manager, an exception in it, a failed statement inside a transaction, a second
begin, visibility before the commit, set_auto_transaction, the run_in_transaction defaults and
the GraphBatch refusal. how-to/transactions.adoc says only what those tests prove, and
tests/test_docs_transactions_page.py runs every block of the page on both backends.
Linked from the nav, the quickstart, databases-and-queries, concurrency and bulk-loads.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tae898
tae898 marked this pull request as ready for review November 6, 2026 01:57
@tae898
tae898 merged commit 7e2131e into main Nov 6, 2026
83 checks passed
@tae898
tae898 deleted the docs/267-results-transactions branch November 6, 2026 03:05
@github-actions github-actions Bot added this to the 26.12.1 milestone Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant