Reference documentation and code samples for the Google.Cloud.Spanner.Data class TransientFaultDetector.
Transactions can be retried using the Transient Fault Handling Application Block.
This extension helps you create a strategy that will detect transient faults when performing
transactions with Spanner.
To create an execution strategy, create a class
class SpannerTransientErrorDetectionStrategy : ITransientErrorDetectionStrategy
{
public bool IsTransient(Exception ex) => ex.IsTransientSpannerFault();
}
public static bool IsTransientSpannerFault(this Exception exception)
Returns true if the exception represents a transient error in Spanner.
This indicates that the operation may succeed if it is attempted again.
Common errors that can cause this include temporary network interruption
or the service being temporarily unavailable.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-09 UTC."],[[["The latest version of the Google.Cloud.Spanner.Data library is 5.0.0-beta05, with numerous prior versions available for reference, dating back to 3.5.0."],["The `TransientFaultDetector` class provides a mechanism to identify transient errors in Spanner transactions, enabling the creation of retry strategies."],["The `IsTransientSpannerFault` method, an extension method on `Exception`, determines if an exception is a transient error that could potentially be resolved with a retry."],["The document contains an example of creating a SpannerTransientErrorDetectionStrategy class that inherits from the ITransientErrorDetectionStrategy interface, and it implements the IsTransient method."],["This reference document contains documentation and code samples for the `TransientFaultDetector` class found in Google.Cloud.Spanner.Data."]]],[]]