Compartilhar via


Transaction Class

Definition

The Transaction object allows grouping of changes made to the store. It ensures that the changes made are atomic and consistent. It also keeps track of the actions performed so that they can be undone at a later stage.

public ref class Transaction : MarshalByRefObject, IDisposable
public class Transaction : MarshalByRefObject, IDisposable
type Transaction = class
    inherit MarshalByRefObject
    interface IDisposable
Public Class Transaction
Inherits MarshalByRefObject
Implements IDisposable
Inheritance
Transaction
Implements

Properties

Context

Returns this transaction's transaction context object

ContextInstance

Return the Context instance that this Transaction is part of.

ForceAllRulesToCommitTime

Get or set a flag that forces all inline rules to fire at LocalCommit time for the current transaction.

HasPendingChanges

Returns true if changes have been made during this transaction

HaveCommitTimeRulesFired

Indicates whether the commit time rules have been fired or not

Id

Return this transaction's id.

InRollback

Returns true if this transaction is beign rolled back

IsActive

Return true if this transaction is active (started but not committed or rolled back). Return false otherwise.

IsHidden

Indicates that a transaction is hidden, and no rules will fire, and it will not go on the undo stack.

IsNested

Indicates that a transaction is nested within another transaction

IsSerializing

Indicates that the transaction is currently serializing

Name

The Name property of this transaction.

Parent

return the parent of this transaction

PartitionStates

Return partition state collection

SequenceNumber

Return this transactions sequence number

Store

Return the Store instance that this Transaction is part of.

TopLevelTransaction

return a reference to the top level transaction that nests this transaction

TransactionDepth

Return the nesting depth of this transaction.

Methods

Commit()

Commit the transaction - persist all the changes and notify listeners.

Dispose()

Disposes the state of this object.

Finalize()

Finalizer.

Rollback()

Abort the transaction - rollback all the changes that have been made so far in this transaction.

Extension Methods

GetSerializationContext(Transaction)

Get the SerializationContext active in the context of the specified transaction. The SerializationContext is stored in the TranactionContext of serializing transactions. If the transaction is nested the transaction stack is searched to find the nearest enclosing serialization transaction with a SerializationContext.

Applies to