Skip to content

Conversation

@olavloite
Copy link
Collaborator

Adds a RunTransaction function that executes read/write transactions in a retry loop, and automatically retries the transaction if it was aborted by Spanner. This prevents ErrAbortedDueToConcurrentModification from being returned.

Using this function requires the transaction to be passed as a function argument instead of using the traditional model of calling Begin and Commit on a connection.

@olavloite olavloite requested a review from a team as a code owner November 13, 2024 14:18
Adds a RunTransaction function that executes read/write transactions in
a retry loop, and automatically retries the transaction if it was aborted
by Spanner. This prevents ErrAbortedDueToConcurrentModification from
being returned.

Using this function requires the transaction to be passed as a function
argument instead of using the traditional model of calling Begin and
Commit on a connection.
@olavloite olavloite merged commit 3731176 into main Nov 14, 2024
16 checks passed
@olavloite olavloite deleted the transaction-runner branch November 14, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants