Visitar URL original
Engine: statement-level savepoints, so a failed multi-row statement inside a transaction is undone on its own · Issue #10346 · ArcadeData/arcadedb · GitHub
Skip to content

Engine: statement-level savepoints, so a failed multi-row statement inside a transaction is undone on its own #10346

Closed

Description

@lvca

Follow-up to #10194 (third point).

Inside a transaction the caller keeps, a multi-row statement that fails midway leaves the records it wrote before the error. SQLite undoes the failed statement and lets the transaction go on. The fix for #10194 does not do that: with no savepoint to go back to, it marks the transaction rollback-only when a statement fails after part of its records were written, so the commit throws and nothing is published (the answer a half-applied delete already gets, #9305). A caller that catches the error of a multi-row statement and wants to carry on with the rest of its transaction cannot.

What a real statement savepoint has to restore (TransactionContext): the modified and new pages, the record caches and the updated-record queue, the new/deleted record sets, the index lanes of TransactionIndexContext, the bucket record deltas, the slot-merge and edge-append buffers and their poisoned-page sets, the insert reservations, the off-page fingerprints, the unidirectional edge changes, and the vector overlay.

Constraints for a design:

  • the statement that owns its transaction (auto-transaction) must pay nothing, since it rolls back whole;
  • inside a caller's transaction the copy of a page is needed only for a page the transaction had already modified before the statement, so the cost is bounded by the pages the statement re-touches;
  • events already fired cannot be taken back.

Once it exists, the rollback-only guard in SQLQueryEngine (refuseCommitOfHalfAppliedStatement) can be replaced by a rollback to the statement's savepoint.

Activity

  1. added
    enhancementNew feature or request
    engineCore engine: document/schema API
    on Oct 19, 2026
  2. added this to the 26.11.1 milestone on Oct 19, 2026
  3. added
    in progressThe team is actively working on this issue
    on Oct 22, 2026
  4. self-assigned this
    on Oct 22, 2026
  5. added 8 commits that reference this issue on Oct 22, 2026
  6. 23 remaining items

  7. added 11 commits that reference this issue on Oct 22, 2026
  8. lvca commented on Oct 22, 2026

    @lvca
    MemberAuthor

    Fixed in #10572 (26.11.1).

    A statement that fails inside a transaction you keep open is now taken back on its own, and the transaction goes on: you can catch the error, run another statement and commit the rest. Before, the commit was refused.

    When a statement cannot be taken back exactly, the commit is still refused, with the reason in the message: it changed more than arcadedb.txStatementSavepointMaxEntries entries (100,000 by default, 0 turns the feature off), it updated a record with an EXTERNAL property that an earlier statement had updated, it changed records a Graph Analytical View follows, or it dropped a file. A Gremlin traversal keeps the old behaviour. Schema changes and events already fired are not undone.


    ❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.

  9. removed
    in progressThe team is actively working on this issue
    on Oct 22, 2026
  10. added a commit that references this issue on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

engineCore engine: document/schema APIenhancementNew feature or requestseverity:minorCosmetic, documentation, edge case, or a workaround existssql

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions