kenhuuu opened a new pull request, #3464: URL: https://github.com/apache/tinkerpop/pull/3464
https://issues.apache.org/jira/browse/TINKERPOP-3253 Adds executeInTx/evaluateInTx to GraphTraversalSource across all GLVs to wrap the begin/commit/rollback lifecycle, so a lambda receives the transaction-bound g and is auto-committed on success or rolled back on error. The methods live on GraphTraversalSource rather than on the Transaction returned by g.tx() because the closure is a Traversal-API convenience; hosting it on the Transaction would hand Driver-API users (who submit strings) a traversal source and mix the two APIs. Keeping it on g also lets Java's existing g.tx() routing cover both embedded and remote with no interface changes. The value-returning form is named evaluateInTx rather than call because call already exists on GraphTraversalSource as the service step, and the InTx suffix keeps the transactional intent clear now that the methods no longer sit under tx(). The surface follows each language's idiom rather than forcing uniformity: dynamic languages expose a single method, while statically typed languages get a void/value pair. Go returns interface{} instead of using generics, to match the driver's existing untyped result API. Behavior is single-shot with no retry, since Gremlin Server has no standardized retriable-error signal across providers. On commit failure a rollback is still attempted for server-side resource hygiene, but the original error stays primary and secondary cleanup failures are only logged. gtx.tx() still returns the same transaction so the commit path keeps working; only opening a second transaction errors. VOTE +1 <!-- Thanks for contributing! Reminders: + TARGET the earliest branch where you want the change 3.7-dev -> 3.7.7 (non-breaking only) 3.8-dev -> 3.8.2 (non-breaking only) master -> 4.0.0 + Committers will MERGE the PR forward to newer versions + ADD entry to the CHANGELOG.asciidoc for the targeted version Do not reference a JIRA number there + ADD JIRA number to title and link in description + PRs requires 3 +1s from committers OR 1 +1 and 7 day wait to merge. + MORE details: https://s.apache.org/rtnal --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
