Exemplo n.º 1
0
 internal void PSPEInitialize(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification)
 {
     base.CommonEnterState(tx);
     try
     {
         promotableSinglePhaseNotification.Initialize();
     }
     finally
     {
         TransactionState._TransactionStateActive.CommonEnterState(tx);
     }
 }
 internal void PSPEInitialize(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification)
 {
     base.CommonEnterState(tx);
     try
     {
         promotableSinglePhaseNotification.Initialize();
     }
     finally
     {
         TransactionState._TransactionStateActive.CommonEnterState(tx);
     }
 }
Exemplo n.º 3
0
        public bool EnlistPromotableSinglePhase(
            IPromotableSinglePhaseNotification notification)
        {
            EnsureIncompleteCurrentScope();

            // The specs aren't entirely clear on whether we can have volatile RMs along with a PSPE, but
            // I'm assuming that yes based on: http://social.msdn.microsoft.com/Forums/br/windowstransactionsprogramming/thread/3df6d4d3-0d82-47c4-951a-cd31140950b3
            if (pspe != null || Durables.Count > 0)
            {
                return(false);
            }

            pspe = notification;
            pspe.Initialize();

            return(true);
        }
Exemplo n.º 4
0
		public bool EnlistPromotableSinglePhase (
			IPromotableSinglePhaseNotification notification)
		{
			EnsureIncompleteCurrentScope ();

			// The specs aren't entirely clear on whether we can have volatile RMs along with a PSPE, but
			// I'm assuming that yes based on: http://social.msdn.microsoft.com/Forums/br/windowstransactionsprogramming/thread/3df6d4d3-0d82-47c4-951a-cd31140950b3
			if (pspe != null || Durables.Count > 0)
				return false;

			pspe = notification;
			pspe.Initialize();

			return true;
		}
Exemplo n.º 5
0
        // This method will call the intialize method on IPromotableSinglePhaseNotification.
        // The tx state will be set to TransactionStatePhase0 to receive and process further
        // enlistments during Phase0. 

        internal void Phase0PSPEInitialize(
            InternalTransaction tx,
            IPromotableSinglePhaseNotification promotableSinglePhaseNotification,
            Guid promoterType)
        {
            Debug.Assert(tx.State == TransactionStatePhase0, "Phase0PSPEInitialize called from state other than TransactionStatePhase0");
            CommonEnterState(tx);

            try
            {
                // Try to initialize the PSPE.  If an exception is thrown let it propagate
                // all the way up to the caller.
                promotableSinglePhaseNotification.Initialize();

                // Set the PromoterType for the transaction.
                tx._promoterType = promoterType;
            }
            finally
            {
                TransactionStatePhase0.CommonEnterState(tx);
            }
        }
Exemplo n.º 6
0
        internal void PSPEInitialize( 
            InternalTransaction tx, 
            IPromotableSinglePhaseNotification promotableSinglePhaseNotification )
        {
            Debug.Assert( tx.State == _TransactionStateActive, "PSPEPromote called from state other than TransactionStateActive" );
            CommonEnterState( tx );

            try
            {
                // Try to initialize the pspn.  If an exception is thrown let it propigate
                // all the way up to the caller.
                promotableSinglePhaseNotification.Initialize();
            }
            finally
            {
                _TransactionStateActive.CommonEnterState( tx );
            }
        }