C# Класс Shielded.CommitContinuation

An object used to commit a transaction at a later time, or from another thread. Returned by Shield.RunToCommit. The transaction has been checked, and is OK to commit. This class is thread-safe - it makes sure only one thread can initiate a commit, but any number of threads may try a rollback in parallel.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Commit ( ) : void

Commit the transaction held in this continuation. Throws if it's already completing/ed.

Dispose ( ) : void

If not Completed, calls Rollback.

InContext ( System.Action act ) : void

Run the action inside the transaction context. Access is limited to exactly what the main transaction already did. Throws if the continuation has completed, dangerous if it is completing.

InContext ( Action act ) : void

Run the action inside the transaction context, with information on the transaction's access pattern given in its argument. Access is limited to exactly what the main transaction already did. Throws if the continuation has completed, dangerous if it is completing.

Rollback ( ) : void

Roll back the transaction held in this continuation. Throws if already completing/ed.

TryCommit ( ) : bool

Try to commit the transaction held in this continuation, returning true if successful. It returns true only if this call actually did the full commit.

TryRollback ( ) : bool

Try to roll back the transaction held in this continuation, returning true if successful. Returns true only if this call actually performs the rollback.

Приватные методы

Метод Описание
StartTimer ( int ms ) : void

Описание методов

Commit() публичный Метод

Commit the transaction held in this continuation. Throws if it's already completing/ed.
public Commit ( ) : void
Результат void

Dispose() публичный Метод

If not Completed, calls Rollback.
public Dispose ( ) : void
Результат void

InContext() публичный абстрактный Метод

Run the action inside the transaction context. Access is limited to exactly what the main transaction already did. Throws if the continuation has completed, dangerous if it is completing.
public abstract InContext ( System.Action act ) : void
act System.Action
Результат void

InContext() публичный Метод

Run the action inside the transaction context, with information on the transaction's access pattern given in its argument. Access is limited to exactly what the main transaction already did. Throws if the continuation has completed, dangerous if it is completing.
public InContext ( Action act ) : void
act Action
Результат void

Rollback() публичный Метод

Roll back the transaction held in this continuation. Throws if already completing/ed.
public Rollback ( ) : void
Результат void

TryCommit() публичный абстрактный Метод

Try to commit the transaction held in this continuation, returning true if successful. It returns true only if this call actually did the full commit.
public abstract TryCommit ( ) : bool
Результат bool

TryRollback() публичный абстрактный Метод

Try to roll back the transaction held in this continuation, returning true if successful. Returns true only if this call actually performs the rollback.
public abstract TryRollback ( ) : bool
Результат bool