Transaction.TransactionDepth Property
Gets the number of transactions in which this transaction is nested.
Assembly: Microsoft.VisualStudio.Modeling.Sdk.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.10.0.dll)
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();
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.