Skip to content

TINKERPOP-3252 Replace Transaction.open() with idempotent begin()#3471

Open
kenhuuu wants to merge 2 commits into
masterfrom
remove-txopen
Open

TINKERPOP-3252 Replace Transaction.open() with idempotent begin()#3471
kenhuuu wants to merge 2 commits into
masterfrom
remove-txopen

Conversation

@kenhuuu

@kenhuuu kenhuuu commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/TINKERPOP-3252

open() and begin() were redundant ways to start a transaction, and the strict "throw if already open" contract was incompatible with the embedded AUTO behavior: a read opens the transaction implicitly, so a later explicit begin() would throw even though the caller did nothing wrong. Collapsing to a single idempotent begin() makes explicit and implicit opens compose, and gives one consistent transaction-start verb across embedded, remote, and all GLVs.

close() is made idempotent for the same reason — so the common try-with-resources / double-close patterns are safe rather than surprising.

The base AbstractTransaction.begin() now opens via a guarded doOpen() so the contract holds for every provider (not just TinkerGraph) and MANUAL mode is no longer broken in the base class.

VOTE +1

Comment thread docs/src/reference/the-traversal.asciidoc Outdated
Comment thread docs/src/reference/the-traversal.asciidoc Outdated
Comment thread docs/src/upgrade/release-4.x.x.asciidoc Outdated
Comment thread docs/src/upgrade/release-4.x.x.asciidoc Outdated
open() and begin() were redundant ways to start a transaction, and the
strict "throw if already open" contract was incompatible with the embedded
AUTO behavior: a read opens the transaction implicitly, so a later explicit
begin() would throw even though the caller did nothing wrong. Collapsing to
a single idempotent begin() makes explicit and implicit opens compose, and
gives one consistent transaction-start verb across embedded, remote, and all
GLVs.

close() is made idempotent for the same reason — so the common
try-with-resources / double-close patterns are safe rather than surprising.

The base AbstractTransaction.begin() now opens via a guarded doOpen() so the
contract holds for every provider (not just TinkerGraph) and MANUAL mode is
no longer broken in the base class.

Assisted-by: Claude Code:claude-opus-4-8
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.

2 participants