Click or drag to resize

Transaction Class

A transaction within the software transactional memory (STM) system. All reads made in a transaction will see a consistent snapshot of the TransactionContext. A transaction will only successfully commit if no update it has made conflicts with any concurrent updates that have been committed since the transaction was started.
Inheritance Hierarchy

Namespace:  AGI.Foundation
Assembly:  AGI.Foundation.Tracking (in AGI.Foundation.Tracking.dll) Version: 24.1.418.0 (24.1.418.0)
public sealed class Transaction : IDisposable

The Transaction type exposes the following members.

Public methodTransaction
Begins a new transaction. Be sure to Dispose, Commit, or Abort this transaction as soon as you are done using it. Keeping transactions open for a long time will substantially increase the memory usage and slow the performance of the software transactional memory system. You should generally use DoTransactionally(ActionTransaction) instead of constructing a transaction directly.
Public propertyContext
Gets the transaction context in which this transaction operates. This transaction can only be used to access transacted objects in this context.
Public propertyIsActive
Gets a value indicating whether or not this transaction is still active. A transaction is active from the time it is constructed until Commit, Abort, or Dispose is called on it.
Public propertyNumber
Gets the number of this transaction. Multiple transactions may share a single number and the number of a transaction may change when it is committed.
Public methodAbort
Aborts this transactions. Any changes made by this transaction will be discarded.
Public methodAddModification
Adds a modification to this transaction. This method is intended to be called within custom TransactedObject implementations.
Public methodCommit
Commits this transaction so that its changes are visible to other transactions. This method may throw TransactionConflictException if another transaction modifies one of the same values as this transaction and the other transaction commits first. Use DoTransactionally(ActionTransaction) to automatically retry conflicting exceptions.
Public methodDispose
Disposes this transaction. It is safe to call this method on a transaction that has already been committed or aborted. If it has not already been committed or aborted, it will be aborted.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
See Also