Starts a batch read-only transaction in executor. Successful outcomes of this
action will contain batch_txn_id--the identificator that can be used to start
the same transaction in other Executors to parallelize partition processing.
Example of a batch read flow:
Start batch transaction with a timestamp (StartBatchTransactionAction)
Generate database partitions for a read or query
(GenerateDbPartitionsForReadAction/GenerateDbPartitionsForQueryAction)
Call ExecutePartitionAction for some or all partitions, process rows
Clean up the transaction (CloseBatchTransactionAction).
More sophisticated example, with parallel processing:
Start batch transaction with a timestamp (StartBatchTransactionAction),
note the returned BatchTransactionId
Generate database partitions for a read or query
(GenerateDbPartitionsForReadAction/GenerateDbPartitionsForQueryAction)
Distribute the partitions over a pool of workers, along with the
transaction ID.
In each worker:
4-1. StartBatchTransactionAction with the given transaction ID
4-2. ExecutePartitionAction for each partition it got, process read results
4-3. Close (not cleanup) the transaction (CloseBatchTransactionAction).
When all workers are done:
Cleanup the transaction (CloseBatchTransactionAction). This can be done
either by the last worker to finish the job, or by the main Executor that
initialized this transaction in the first place. It is also possible to clean
it up with a brand new Executor -- just execute StartBatchTransactionAction
with the ID, then clean it up right away.
Cleaning up is optional, but recommended.
Protobuf type google.spanner.executor.v1.StartBatchTransactionAction
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-28 UTC."],[],[]]