Skip to content

database.batch does not retry aborted transactions #1133

Closed
@olavloite

Description

@olavloite

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:

  1. The sample(s) should be updated to show how to use run_in_transaction to use mutations.
  2. And/or: database.batch should also automatically retry aborted transactions.

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/python-spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions