FulcrumFS FulcrumFS
FulcrumFS FulcrumFS
DocFX + Singulink = ♥

Search Results for

    Method CommitAsync

    CommitAsync(CancellationToken)

    Commits the transaction, making all file additions and deletion made during the transaction permanent in the repository.

    Declaration
    public Task CommitAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    A cancellation token that cancels the call while it waits for another call on this transaction to finish. Once the commit has started it is not observed.

    Returns
    Type Description
    Task
    Implements
    IFileRepoTransaction.CommitAsync(CancellationToken)
    Remarks

    In the deferred delete modes the deletions are recorded for the cleaner: a transaction that deletes two or more files records them in one delete journal, flushed to disk once for all of them, on a repository whose FormatVersion is 2 or later, and otherwise each deleted file gets a delete marker of its own. In Immediate mode the files are deleted now; one that cannot be deleted at once gets a delete marker, and a cleanup pass deletes it.

    A failure to commit an individual file, or to write the journal, is not thrown: it is reported through TransactionCompletionFailed. If the journal cannot be written, each deletion is recorded with its own delete marker instead. A file whose commit failed stays accessible in an indeterminate state for the next cleanup pass to resolve.

    An indeterminate marker that cannot be removed because something else has it open is tolerated, not reported: removing the marker is what commits an added file, the file is accessible either way, and it stays indeterminate until the next cleanup pass resolves it and removes the marker. The attempt is logged to the marker (see MarkerFileLogging).

    The files are committed one by one, so the transaction has no single point at which it commits, and once the commit has started the method throws in two cases only: a TransactionCompletionFailed handler threw, which happens after every file has been attempted, or the repository has been disposed, which leaves the files not yet committed indeterminate. Neither means that the transaction was rolled back, and disposing it afterwards rolls nothing back. An OperationCanceledException is thrown before the commit has started: nothing has been committed, the transaction is still open, and disposing it rolls it back. Pass None once the application's database has committed.

    Exceptions
    Type Condition
    OperationCanceledException

    The token was cancelled before the commit had started. Nothing has been committed.

    ObjectDisposedException

    The transaction has been disposed: nothing is committed, and a transaction that was disposed without having been committed was rolled back by its disposal. Or the repository has been disposed: the files that had not been committed yet are left indeterminate.

    © Singulink. All rights reserved.