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 details the \u003ccode\u003eTransactionRerunPolicy\u003c/code\u003e class within the Google Cloud Spanner C++ library, which manages the conditions under which transactions are retried.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eClient::Commit()\u003c/code\u003e function utilizes the \u003ccode\u003eTransactionRerunPolicy\u003c/code\u003e to determine if a failed transaction should be re-attempted, involving either a mutation-generating callable or a list of mutations.\u003c/p\u003e\n"],["\u003cp\u003eThe webpage lists numerous versions of the Spanner library, starting from version 2.37.0-rc (the latest) down to version 2.11.0, with each version offering a link to the respective \u003ccode\u003eTransactionRerunPolicy\u003c/code\u003e documentation.\u003c/p\u003e\n"],["\u003cp\u003eKey functions of the \u003ccode\u003eTransactionRerunPolicy\u003c/code\u003e include \u003ccode\u003eclone()\u003c/code\u003e for creating new policy instances, \u003ccode\u003eOnFailure()\u003c/code\u003e for handling failed transactions, and \u003ccode\u003eIsExhausted()\u003c/code\u003e and \u003ccode\u003eIsPermanentFailure()\u003c/code\u003e for determining retry status.\u003c/p\u003e\n"]]],[],null,[]]