Conversation
This behaves the same as the TraversalOpProcessor would have in the 3.x line. All traversals are now transactional if the underlying Graph supports transactions. Traversals that aren't explicitly in a transaction are now wrapped into their own implicit transaction and the server will autocommit on sucess and rollback on failure. Assisted-by: Kiro:claude-opus-4-6
Split executeAndStream() into sendRequest() (synchronous HTTP call) and streamResponse() (async body streaming). submit() now blocks until the server acknowledges the request (response headers received), then streams the body in the background. Non-GraphBinary HTTP errors (400/500 with text/JSON bodies) are now returned directly from submit() instead of being embedded in the ResultSet. Tests updated accordingly. Assisted-by: Kiro:claude-opus-4-6
Implement Transaction classes in gremlin-python, gremlin-go, gremlin-javascript, and gremlin-dotnet that mirror the Java HttpRemoteTransaction. Transaction wraps a Client and provides begin/commit/rollback/close lifecycle plus a submit() method for plain gremlin-lang strings. Key design decisions: - Default close behavior changed from commit to rollback (all GLVs) - Transactions are single-use (terminal state after commit/rollback) - gtx.tx() returns the same Transaction (enables gtx.tx().commit()) Assisted-by: Kiro:claude-opus-4-6
|
|
||
| IMPORTANT: Transaction support over HTTP is not yet implemented in Gremlin-Go. This will be addressed by the official | ||
| 4.0.0 release. | ||
| Gremlin-Go supports remote transactions over HTTP. Transactions can be created from a `GraphTraversalSource` or |
There was a problem hiding this comment.
we can't exactly say scripts vs bytecode anymore, but GraphTraversalSource vs Client doesn't sound quite right either. or maybe the way its introduced is sounding off to me?
Upgrade docs describe it as:
- Traversal API:
g.tx().begin()returns a transaction-boundGraphTraversalSource- Driver API:
client.transact()(orclient.Transact()in .NET) returns aTransactionwithsubmit()methods
seems like it should at least be consistent with that.
| and there is no way in TinkerPop to string together multiple traversals into the same transaction. | ||
|
|
||
| IMPORTANT: 4.0.0-beta.1 Release - Remote transactions are not supported in this beta. | ||
| Remote transactions are supported across all GLVs. See the <<transactions,Transactions>> section and each GLV's |
There was a problem hiding this comment.
since this section is on limitations, i think the point is to assume there is complete transaction support. we'd only document the absence of support.
|
|
||
| The default behavior of `close()` on a remote transaction has been changed from `commit` to `rollback` across all | ||
| GLVs (including the Java driver). This aligns with the embedded graph transaction default and is the safer behavior: | ||
| partial work is discarded if the user forgets to call `commit()`. In Java, the behavior can still be overridden via |
There was a problem hiding this comment.
Might be more accurate to say that "In Java with embedded mode,"
| import { Traversal, Traverser } from '../process/traversal.js'; | ||
| import type { ConnectionOptions } from './connection.js'; | ||
|
|
||
| export type RemoteConnectionOptions = ConnectionOptions & { session?: string }; |
There was a problem hiding this comment.
If sessions are being removed, should this be removed as well?
| private readonly IGremlinClient _client; | ||
| private readonly string _traversalSource; | ||
| // Serializes all submissions to guarantee ordering. Matches the role of | ||
| // Java's synchronized on HttpRemoteTransaction.submitInternal. |
There was a problem hiding this comment.
I think we can remove this line.
| defer t.mutex.Unlock() | ||
|
|
||
| if !t.isOpen { | ||
| return newError(err1102TransactionRollbackNotOpenedError) |
There was a problem hiding this comment.
These are both being called by Commit() and Rollback() and should have different errors.
| /// Synchronous dispose (required by IGremlinClient/IDisposable). | ||
| /// Does not attempt rollback. Use <c>await using</c> for proper cleanup. | ||
| /// </summary> | ||
| public void Dispose() |
There was a problem hiding this comment.
Should this have rollback for sync?
Implement Transaction classes in gremlin-python, gremlin-go, gremlin-javascript, and gremlin-dotnet that mirror the Java HttpRemoteTransaction. Transaction wraps a Client and provides begin/commit/rollback/close lifecycle plus a submit() method for plain gremlin-lang strings.
gremlin-driver's default transaction close behavior is now rollback to match all GLVs.
Also changes how requests are submitted in gremlin-go. In particular it now waits for response headers before returning. This allows users to check if the response returns an err (pretty much any non-200 OK response), before having to check the ResultSet itself.