C# Class 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.
Inheritance: IDisposable
显示文件 Open project: jbakic/Shielded Class Usage Examples

Public Methods

Method Description
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.

Private Methods

Method Description
StartTimer ( int ms ) : void

Method Details

Commit() public method

Commit the transaction held in this continuation. Throws if it's already completing/ed.
public Commit ( ) : void
return void

Dispose() public method

If not Completed, calls Rollback.
public Dispose ( ) : void
return void

InContext() public abstract method

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
return void

InContext() public method

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
return void

Rollback() public method

Roll back the transaction held in this continuation. Throws if already completing/ed.
public Rollback ( ) : void
return void

TryCommit() public abstract method

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
return bool

TryRollback() public abstract method

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
return bool