Closed
Description
The standard example for writing data with mutations uses database.batch
: https://cloud.google.com/spanner/docs/getting-started/python#write-data-with-mutations
database.batch
however does not automatically retry the transaction if it is aborted by Spanner. This causes errors if you try to use this method to insert a large amount of data, or if there are lock contentions on the data that you insert.
Either:
- The sample(s) should be updated to show how to use
run_in_transaction
to use mutations. - And/or:
database.batch
should also automatically retry aborted transactions.