Promote() private méthode

private Promote ( ) : DistributedTransaction
Résultat DistributedTransaction
        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);
        }
Exemple #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();
 }
Exemple #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());
 }
        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;
        }
        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;
        }