Begin returns the session ticket, but also attaches it to the TransactionalExecutionContext if it's available.
Begin returns the session ticket, but also attaches it to the TransactionalExecutionContext if it's available.
ctx
ec
commit finishes out the transaction, and nullifys the session ticket.
commit finishes out the transaction, and nullifys the session ticket. It will throw a NotInTransaction if you do not have a valid TransactionalExecutionContext.
This is a slightly less low-level call that really does two big things.
This is a slightly less low-level call that really does two big things.
1) it converts the result into something nice. 2) It handles threading the TxnEc. The way Session works is that every operation needs a session from the previous response of an operation to continue the txn. This uses the TxnEc to achieve that.
See commit() but for rollbacks
See commit() but for rollbacks
Executes the StreamExecuteRequest with vtgate, with some extra help for converting to rows.
Executes the StreamExecuteRequest with vtgate, with some extra help for converting to rows. Below is some information about how fields vs values work.
As returned by StreamExecute, the first QueryResult has the fields set, and subsequent QueryResult have rows set. And as Execute, len(QueryResult[0].fields) is always equal to len(row) (for each row in rows for each QueryResult in QueryResult[1:]).
Transaction takes a TransactionalExecutionContext => Future and handles all the cleanup of failed attempts etc.
Transaction takes a TransactionalExecutionContext => Future and handles all the cleanup of failed attempts etc.