Method RollbackAsync
RollbackAsync(CancellationToken)
Rolls back the transaction, discarding the files it added and the deletions it recorded, and deleting its journal if it was staged. The transaction cannot be used afterwards.
Declaration
public Task RollbackAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | A cancellation token that cancels the operation. |
Returns
| Type | Description |
|---|---|
| Task |
Implements
Remarks
Rolling back is possible before and after staging. Once CommitAsync(CancellationToken) has been called, this method does nothing, because the application has committed its database by then: a commit that failed can still be retried, and if it is not, disposing the transaction leaves its files indeterminate for the cleaner to resolve.
Failures to roll back individual files or to delete the journal are not thrown; they are reported through TransactionCompletionFailed, as for an ordinary transaction, and the affected files are left for the cleaner.