System.Transactions.TransactionStatePSPEOperation.SetDistributedTransactionId C# (CSharp) Method

SetDistributedTransactionId() private method

private SetDistributedTransactionId ( InternalTransaction tx, IPromotableSinglePhaseNotification promotableNotification, System.Guid distributedTransactionIdentifier ) : void
tx InternalTransaction
promotableNotification IPromotableSinglePhaseNotification
distributedTransactionIdentifier System.Guid
return void
        internal override void SetDistributedTransactionId(InternalTransaction tx,
                    IPromotableSinglePhaseNotification promotableNotification,
                    Guid distributedTransactionIdentifier)
        {
            // This call is only allowed if we have an outstanding call to ITransactionPromoter.Promote.
            if (!tx._attemptingPSPEPromote)
            {
                throw TransactionException.CreateTransactionStateException(tx._innerException, tx.DistributedTxId);
            }

            if (promotableNotification != tx._promoter)
            {
                throw TransactionException.CreateInvalidOperationException(
                        TraceSourceType.TraceSourceLtm,
                        SR.InvalidIPromotableSinglePhaseNotificationSpecified,
                        null,
                        tx.DistributedTxId
                        );
            }

            tx._distributedTransactionIdentifierNonMSDTC = distributedTransactionIdentifier;
        }