public interface TransactionRetryListener
Connection
can automatically retry a transaction internally and check whether the results
that are returned during a retry attempt are equal to the results during the original
transaction. This is done by keeping track of a SHA-256 checksum of all the results that are
returned by Spanner during both transactions.
This listener class for internal transaction retries allow client applications to do
additional testing or logging of transaction retries. Transaction retry listeners of a Connection
can be added using Connection.addTransactionRetryListener(TransactionRetryListener)
.
Modifier and Type | Interface and Description |
---|---|
static class |
TransactionRetryListener.RetryResult
The result of a retry.
|
Modifier and Type | Method and Description |
---|---|
void |
retryFinished(com.google.cloud.Timestamp transactionStarted,
long transactionId,
int retryAttempt,
TransactionRetryListener.RetryResult result)
This method is called when a retry has finished.
|
void |
retryStarting(com.google.cloud.Timestamp transactionStarted,
long transactionId,
int retryAttempt)
This method is called when a retry is about to start.
|
void retryStarting(com.google.cloud.Timestamp transactionStarted, long transactionId, int retryAttempt)
transactionStarted
- The start date/time of the transaction that is retrying.transactionId
- An internally assigned ID of the transaction (unique during the lifetime
of the JVM) that can be used to identify the transaction for logging purposes.retryAttempt
- The number of retry attempts the current transaction has executed,
including the current retry attempt.void retryFinished(com.google.cloud.Timestamp transactionStarted, long transactionId, int retryAttempt, TransactionRetryListener.RetryResult result)
transactionStarted
- The start date/time of the transaction that is retrying.transactionId
- An internally assigned ID of the transaction (unique during the lifetime
of the JVM) that can be used to identify the transaction for logging purposes.retryAttempt
- The number of retry attempts the current transaction has executed,
including the current retry attempt.result
- The result of the retry indicating whether the retry was successful or not.Copyright © 2019 Google LLC. All rights reserved.