System.Transactions.Transaction.Promote C# (CSharp) Method

Promote() private method

private Promote ( ) : DistributedTransaction
return DistributedTransaction
        internal DistributedTransaction Promote()
        {
            lock (_internalTransaction)
            {
                // This method is only called when we expect to be promoting to MSDTC.
                _internalTransaction.ThrowIfPromoterTypeIsNotMSDTC();
                _internalTransaction.State.Promote(_internalTransaction);
                return _internalTransaction.PromotedTransaction;
            }
        }
    }

Usage Example

Example #1
0
        internal static DistributedTransaction ConvertToDistributedTransaction(Transaction transaction)
        {
            if (null == transaction)
            {
                throw new ArgumentNullException(nameof(transaction));
            }

            if (transaction.Disposed)
            {
                throw new ObjectDisposedException(nameof(Transaction));
            }

            if (transaction._complete)
            {
                throw TransactionException.CreateTransactionCompletedException(transaction.DistributedTxId);
            }

            DistributedTransaction distributedTx = transaction.Promote();

            if (distributedTx == null)
            {
                throw DistributedTransaction.NotSupported();
            }
            return(distributedTx);
        }
All Usage Examples Of System.Transactions.Transaction::Promote