상속: IDisposable
        internal static void DistributedTransactionOutcome(InternalTransaction tx, TransactionStatus status)
        {
            FinalizedObject finalizedObject = null;

            lock (tx)
            {
                if (tx.innerException == null)
                {
                    tx.innerException = tx.PromotedTransaction.InnerException;
                }
                switch (status)
                {
                case TransactionStatus.Committed:
                    tx.State.ChangeStatePromotedCommitted(tx);
                    break;

                case TransactionStatus.Aborted:
                    tx.State.ChangeStatePromotedAborted(tx);
                    break;

                case TransactionStatus.InDoubt:
                    tx.State.InDoubtFromDtc(tx);
                    break;

                default:
                    TransactionException.CreateInvalidOperationException(System.Transactions.SR.GetString("TraceSourceLtm"), "", null);
                    break;
                }
                finalizedObject = tx.finalizedObject;
            }
            if (finalizedObject != null)
            {
                finalizedObject.Dispose();
            }
        }
예제 #2
0
        internal static void DistributedTransactionOutcome(InternalTransaction tx, TransactionStatus status)
        {
            FinalizedObject fo = null;

            lock ( tx )
            {
                if (null == tx.innerException)
                {
                    tx.innerException = tx.PromotedTransaction.InnerException;
                }

                switch (status)
                {
                case TransactionStatus.Committed:
                {
                    tx.State.ChangeStatePromotedCommitted(tx);
                    break;
                }

                case TransactionStatus.Aborted:
                {
                    tx.State.ChangeStatePromotedAborted(tx);
                    break;
                }

                case TransactionStatus.InDoubt:
                {
                    tx.State.InDoubtFromDtc(tx);
                    break;
                }

                default:
                {
                    Debug.Assert(false, "InternalTransaction.DistributedTransactionOutcome - Unexpected TransactionStatus");
                    TransactionException.CreateInvalidOperationException(SR.GetString(SR.TraceSourceLtm),
                                                                         "",
                                                                         null,
                                                                         tx.DistributedTxId
                                                                         );
                    break;
                }
                }

                fo = tx.finalizedObject;
            }

            if (null != fo)
            {
                fo.Dispose();
            }
        }
        internal static void DistributedTransactionOutcome(InternalTransaction tx, TransactionStatus status)
        {
            FinalizedObject finalizedObject = null;
            lock (tx)
            {
                if (tx.innerException == null)
                {
                    tx.innerException = tx.PromotedTransaction.InnerException;
                }
                switch (status)
                {
                    case TransactionStatus.Committed:
                        tx.State.ChangeStatePromotedCommitted(tx);
                        break;

                    case TransactionStatus.Aborted:
                        tx.State.ChangeStatePromotedAborted(tx);
                        break;

                    case TransactionStatus.InDoubt:
                        tx.State.InDoubtFromDtc(tx);
                        break;

                    default:
                        TransactionException.CreateInvalidOperationException(System.Transactions.SR.GetString("TraceSourceLtm"), "", null);
                        break;
                }
                finalizedObject = tx.finalizedObject;
            }
            if (finalizedObject != null)
            {
                finalizedObject.Dispose();
            }
        }