pub struct TransactionCommitError { /* private fields */ }Expand description
A failed to commit transaction.
Implementations§
Source§impl TransactionCommitError
impl TransactionCommitError
Sourcepub fn on_error(self) -> impl Future<Output = FdbResult<Transaction>>
pub fn on_error(self) -> impl Future<Output = FdbResult<Transaction>>
Implements the recommended retry and backoff behavior for a transaction. This function knows
which of the error codes generated by other Transaction functions represent temporary
error conditions and which represent application errors that should be handled by the
application. It also implements an exponential backoff strategy to avoid swamping the
database cluster with excessive retries when there is a high level of conflict between
transactions.
You should not call this method most of the times and use Database::transact which
implements a retry loop strategy for you.
Sourcepub async fn conflicting_keys(&self) -> FdbResult<Vec<ConflictingKeyRange>>
pub async fn conflicting_keys(&self) -> FdbResult<Vec<ConflictingKeyRange>>
Reads the conflicting key ranges that caused this commit failure.
Only returns meaningful results if
TransactionOption::ReportConflictingKeys
was set on the transaction and the error is not_committed (code 1020).
Must be called before on_error which resets the transaction.
§Errors
Returns an FdbError if the special keyspace read fails.
Sourcepub fn reset(self) -> Transaction
pub fn reset(self) -> Transaction
Reset the transaction to its initial state.
This is similar to dropping the transaction and creating a new one.