Skip to content

docs(sql): TRUNCATE TYPE / TRUNCATE BUCKET document their transactional behaviour - #442

Merged
lvca merged 1 commit into
mainfrom
issue-6220-truncate-transaction
Aug 17, 2026
Merged

docs(sql): TRUNCATE TYPE / TRUNCATE BUCKET document their transactional behaviour#442
lvca merged 1 commit into
mainfrom
issue-6220-truncate-transaction

Conversation

@lvca

@lvca lvca commented Aug 16, 2026

Copy link
Copy Markdown
Member

Companion to ArcadeData/arcadedb#6225 (fixes ArcadeData/arcadedb#6220).

Both TRUNCATE reference pages described what the command deletes and said nothing about what a ROLLBACK after it does. Until v26.9.1 the answer was "almost nothing": the statement committed the caller's transaction from the inside - dropping the type's indexes, then committing once per arcadedb.truncateBatchSize records - so a rollback recovered at most the records of the last uncommitted batch, and none at all when the type had any index.

The behaviour now depends on whether a transaction is active when the command runs, and that is also how a user chooses between the two paths:

  • inside a transaction, the truncate is part of it and a ROLLBACK puts every record back (transactional: true);
  • with none active, the command owns a transaction of its own and takes the faster drop-indexes / batch-delete / rebuild path, which commits as it goes and cannot be undone (transactional: false).

Over HTTP the request's auto-commit transaction decides, so "autoCommit": false selects the faster path.

Each page gains a Transactions section saying this, names the transactional field the result set now reports, and carries a NOTE about the pre-26.9.1 behaviour for anyone reading against an older server.

…al behaviour (arcadedb#6220)

Both pages described what the command deletes and said nothing about what a ROLLBACK after it does. Until
v26.9.1 the answer was "almost nothing": the statement committed the caller's transaction from the inside -
dropping the type's indexes, then committing once per arcadedb.truncateBatchSize records - so a rollback
recovered at most the last uncommitted batch, and none of it when the type had any index.

The behaviour now depends on whether a transaction is active when the command runs, which is worth stating
because it is also how a user chooses between the two: inside a transaction the truncate is part of it and a
ROLLBACK puts every record back; with none active the command owns one and takes the faster drop-indexes /
batch-delete / rebuild path, which commits as it goes and cannot be undone. Over HTTP the request's
auto-commit transaction decides, so "autoCommit": false selects the faster path.

Each page also names the `transactional` field the result set now reports, and carries a note about the
pre-26.9.1 behaviour for anyone reading against an older server.
@lvca lvca self-assigned this Aug 16, 2026
@mergify

mergify Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@lvca
lvca merged commit 7716ebd into main Aug 17, 2026
3 of 4 checks passed
@lvca
lvca deleted the issue-6220-truncate-transaction branch August 17, 2026 05:18
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.

TRUNCATE TYPE inside an explicit transaction commits it: ROLLBACK does not put the records back

1 participant