C# Class Nexus.Transactions.TransactionScope

Manages the ambient transaction.
Inheritance: IDisposable
Show file Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Public Methods

Method Description
Complete ( ) : void

Completes the transaction.

This method gets votes from all the participants on whether or not the transaction should be committed.

Dispose ( ) : void

Disposes of the transaction scope, and removes the ambient transaction.

This makes sure the transaction is rolled back if the scope hasn't completed.

TransactionScope ( ) : System

The default constructor.

This sets up the ambient transaction. This class allows the sharing of a transaction across multiple threads. However, it is expected that all threads created in the scope of the TransactionScope will have finished their work before Complete() is called. If a thread does work after Complete() has been called, expecting to enroll in the same transaction, the behaviour is undefined.

Method Details

Complete() public method

Completes the transaction.
This method gets votes from all the participants on whether or not the transaction should be committed.
public Complete ( ) : void
return void

Dispose() public method

Disposes of the transaction scope, and removes the ambient transaction.
This makes sure the transaction is rolled back if the scope hasn't completed.
public Dispose ( ) : void
return void

TransactionScope() public method

The default constructor.
This sets up the ambient transaction. This class allows the sharing of a transaction across multiple threads. However, it is expected that all threads created in the scope of the TransactionScope will have finished their work before Complete() is called. If a thread does work after Complete() has been called, expecting to enroll in the same transaction, the behaviour is undefined.
public TransactionScope ( ) : System
return System