Transaction.TransactionDepth Property

Gets the number of transactions in which this transaction is nested.

Namespace:  Microsoft.VisualStudio.Modeling
Assembly:  Microsoft.VisualStudio.Modeling.Sdk (in Microsoft.VisualStudio.Modeling.Sdk.dll)

Syntax

'Declaration
Public ReadOnly Property TransactionDepth As Integer
'Usage
Dim instance As Transaction 
Dim value As Integer 

value = instance.TransactionDepth
public int TransactionDepth { get; }
public:
property int TransactionDepth {
    int get ();
}
public function get TransactionDepth () : int

Property Value

Type: System.Int32
A number that indicates the level of this transaction in the transaction hierarchy.

Remarks

This represents how many levels this transaction is nested within.

Examples

The following example creates several transactions that are nested and indicates the value of the TransactionDepth property for each transaction.

Transaction t = store.TransactionManager.BeginTransaction("Top");
// t.TransactionDepth equals 1

Transaction t2 = store.TransactionManager.BeginTransaction("Next");
Transaction t3 = store.TransactionManager.BeginTransaction("Another");
// t2.TransactionDepth equals 2
// t3.TransactionDepth equals 3

t3.Commit();
t2.Commit();

Transaction t4 = store.TransactionManager.BeginTransaction("Last");
// t4.TransactionDepth equals 2

t4.Commit();
t.Commit();

t.Dispose();
t2.Dispose();
t3.Dispose();
t4.Dispose();

.NET Framework Security

See Also

Reference

Transaction Class

Transaction Members

Microsoft.VisualStudio.Modeling Namespace