Promote() private method

private Promote ( ) : DistributedTransaction
return DistributedTransaction
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);
        }
Example #2
0
        internal static OletxTransaction ConvertToOletxTransaction(
            Transaction transaction
            )
        {
            if (null == transaction)
            {
                throw new ArgumentNullException("transaction");
            }

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

            if (transaction.complete)
            {
                throw TransactionException.CreateTransactionCompletedException(SR.GetString(SR.TraceSourceLtm), transaction.DistributedTxId);
            }

            OletxTransaction oletxTx = transaction.Promote();

            System.Diagnostics.Debug.Assert(oletxTx != null, "transaction.Promote returned null instead of throwing.");

            return(oletxTx);
        }
 internal static OletxTransaction ConvertToOletxTransaction(Transaction transaction)
 {
     if (null == transaction)
     {
         throw new ArgumentNullException("transaction");
     }
     if (transaction.Disposed)
     {
         throw new ObjectDisposedException("Transaction");
     }
     if (transaction.complete)
     {
         throw TransactionException.CreateTransactionCompletedException(System.Transactions.SR.GetString("TraceSourceLtm"));
     }
     return transaction.Promote();
 }
Example #4
0
 internal static OletxTransaction ConvertToOletxTransaction(Transaction transaction)
 {
     if (null == transaction)
     {
         throw new ArgumentNullException("transaction");
     }
     if (transaction.Disposed)
     {
         throw new ObjectDisposedException("Transaction");
     }
     if (transaction.complete)
     {
         throw TransactionException.CreateTransactionCompletedException(System.Transactions.SR.GetString("TraceSourceLtm"));
     }
     return(transaction.Promote());
 }
Example #5
0
        internal static OletxTransaction ConvertToOletxTransaction(Transaction transaction)
        {
            ArgumentNullException.ThrowIfNull(transaction);

            ObjectDisposedException.ThrowIf(transaction.Disposed, transaction);

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

            OletxTransaction?oletxTx = transaction.Promote();

            Debug.Assert(oletxTx != null, "transaction.Promote returned null instead of throwing.");

            return(oletxTx);
        }
        internal static OletxTransaction ConvertToOletxTransaction(Transaction transaction)
        {
            ArgumentNullException.ThrowIfNull(transaction);

            ObjectDisposedException.ThrowIf(transaction.Disposed, transaction);

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

            OletxTransaction?distributedTx = transaction.Promote();

            if (distributedTx == null)
            {
                throw OletxTransaction.NotSupported();
            }
            return(distributedTx);
        }
        internal static OletxTransaction ConvertToOletxTransaction(
            Transaction transaction
            )
        {
            if ( null == transaction )
            {
                throw new ArgumentNullException( "transaction" );
            }

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

            if ( transaction.complete )
            {
                throw TransactionException.CreateTransactionCompletedException( SR.GetString( SR.TraceSourceLtm ) );
            }

            OletxTransaction oletxTx = transaction.Promote();
            System.Diagnostics.Debug.Assert( oletxTx != null, "transaction.Promote returned null instead of throwing." );

            return oletxTx;
        }
Example #8
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(SR.TraceSourceLtm, transaction.DistributedTxId);
            }

            DistributedTransaction distributedTx = transaction.Promote();
            if (distributedTx == null)
            {
                throw DistributedTransaction.NotSupported();
            }
            return distributedTx;
        }