GetCurrentTransactionAndScope() static private method

static private GetCurrentTransactionAndScope ( TxLookup defaultLookup, Transaction &current, TransactionScope &currentScope, Transaction &contextTransaction ) : void
defaultLookup TxLookup
current Transaction
currentScope TransactionScope
contextTransaction Transaction
return void
 private void CommonInitialize()
 {
     this.complete               = false;
     this.dependentTransaction   = null;
     this.disposed               = false;
     this.committableTransaction = null;
     this.expectedCurrent        = null;
     this.scopeTimer             = null;
     this.scopeThread            = Thread.CurrentThread;
     Transaction.GetCurrentTransactionAndScope(out this.savedCurrent, out this.savedCurrentScope, out this.threadContextData, out this.contextTransaction);
 }
示例#2
0
        private void CommonInitialize()
        {
            ContextKey              = new ContextKey();
            _complete               = false;
            _dependentTransaction   = null;
            _disposed               = false;
            _committableTransaction = null;
            _expectedCurrent        = null;
            _scopeTimer             = null;
            _scopeThread            = Thread.CurrentThread;

            Transaction.GetCurrentTransactionAndScope(
                AsyncFlowEnabled ? TxLookup.DefaultCallContext : TxLookup.DefaultTLS,
                out _savedCurrent,
                out _savedCurrentScope,
                out _contextTransaction
                );

            // Calling validate here as we need to make sure the existing parent ambient transaction scope is already looked up to see if we have ES interop enabled.
            ValidateAsyncFlowOptionAndESInteropOption();
        }