The base class for the Spanner library transaction rerun policies.
The Client::Commit() functions (there are several overloads) consume a callable to create mutations or a list of mutations. Commit() creates a transaction and applies the mutations. If the transaction fails, an instance of this class is used to control whether the transaction will be attempted again.
Functions
clone() const
Creates a new instance of the policy, reset to the initial state.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-22 UTC."],[[["\u003cp\u003eThis webpage provides documentation for the \u003ccode\u003eTransactionRerunPolicy\u003c/code\u003e class within the Google Cloud Spanner C++ client library, spanning multiple versions from 2.11.0 to the latest release candidate 2.37.0-rc.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eTransactionRerunPolicy\u003c/code\u003e class is used to manage the retry logic when a Spanner transaction fails during the \u003ccode\u003eClient::Commit()\u003c/code\u003e process, allowing control over whether or not the transaction should be attempted again.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCommit()\u003c/code\u003e function uses this policy to determine whether a failed transaction should be reattempted after calling a callable to create mutations or a list of mutations, creating a transaction and applying the mutations.\u003c/p\u003e\n"],["\u003cp\u003eKey functions within the \u003ccode\u003eTransactionRerunPolicy\u003c/code\u003e class include \u003ccode\u003eclone()\u003c/code\u003e, \u003ccode\u003eOnFailure()\u003c/code\u003e, \u003ccode\u003eIsExhausted()\u003c/code\u003e, and \u003ccode\u003eIsPermanentFailure()\u003c/code\u003e, allowing for the creation of a new policy instance, failure management, checking retry limit, and detecting permanent errors, respectively.\u003c/p\u003e\n"],["\u003cp\u003eEach version's documentation is linked to its respective \u003ccode\u003eTransactionRerunPolicy\u003c/code\u003e class, such as version 2.33.0, linked to \u003ccode\u003eclassgoogle_1_1cloud_1_1spanner_1_1TransactionRerunPolicy\u003c/code\u003e, which is repeated for each linked version.\u003c/p\u003e\n"]]],[],null,[]]