Beispiel #1
0
        private void OnSendRegisterComplete(CoordinatorEnlistment coordinator, ControlProtocol protocol, IAsyncResult ar)
        {
            SynchronizationEvent event2;
            EndpointAddress      to = null;

            try
            {
                RegisterResponse response = coordinator.RegistrationProxy.EndSendRegister(ar);
                to = response.CoordinatorProtocolService;
                TwoPhaseCommitCoordinatorProxy proxy = this.state.TryCreateTwoPhaseCommitCoordinatorProxy(to);
                if (proxy == null)
                {
                    if (RegistrationCoordinatorResponseInvalidMetadataRecord.ShouldTrace)
                    {
                        RegistrationCoordinatorResponseInvalidMetadataRecord.Trace(coordinator.EnlistmentId, coordinator.SuperiorContext, protocol, to, null, this.state.ProtocolVersion);
                    }
                    event2 = new MsgRegistrationCoordinatorSendFailureEvent(coordinator);
                }
                else
                {
                    try
                    {
                        if (protocol == ControlProtocol.Durable2PC)
                        {
                            event2 = new MsgRegisterDurableResponseEvent(coordinator, response, proxy);
                        }
                        else
                        {
                            VolatileCoordinatorEnlistment asyncState = (VolatileCoordinatorEnlistment)ar.AsyncState;
                            event2 = new MsgRegisterVolatileResponseEvent(asyncState, response, proxy);
                        }
                    }
                    finally
                    {
                        proxy.Release();
                    }
                }
            }
            catch (WsatFaultException exception)
            {
                Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
                event2 = new MsgRegistrationCoordinatorFaultEvent(coordinator, protocol, exception.Fault);
                if (RegistrationCoordinatorFaultedRecord.ShouldTrace)
                {
                    RegistrationCoordinatorFaultedRecord.Trace(coordinator.EnlistmentId, coordinator.SuperiorContext, protocol, exception.Fault);
                }
            }
            catch (WsatMessagingException exception2)
            {
                Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception2, TraceEventType.Warning);
                this.state.Perf.MessageSendFailureCountPerInterval.Increment();
                if (RegistrationCoordinatorFailedRecord.ShouldTrace)
                {
                    RegistrationCoordinatorFailedRecord.Trace(coordinator.EnlistmentId, coordinator.SuperiorContext, protocol, exception2);
                }
                DebugTrace.TraceSendFailure(coordinator.EnlistmentId, exception2);
                event2 = new MsgRegistrationCoordinatorSendFailureEvent(coordinator);
            }
            coordinator.StateMachine.Enqueue(event2);
        }
Beispiel #2
0
 public void SendReadOnly(EndpointAddress sendTo)
 {
     if (sendTo != null)
     {
         TwoPhaseCommitCoordinatorProxy proxy = this.state.TryCreateTwoPhaseCommitCoordinatorProxy(sendTo);
         if (proxy != null)
         {
             try
             {
                 if (DebugTrace.Info)
                 {
                     DebugTrace.Trace(TraceLevel.Info, "Sending ReadOnly to unrecognized participant at {0}", Ports.TryGetAddress(proxy));
                 }
                 IAsyncResult ar = proxy.BeginSendReadOnly(this.politeSendComplete, proxy);
                 if (ar.CompletedSynchronously)
                 {
                     this.OnPoliteSendComplete(ar, proxy);
                 }
             }
             finally
             {
                 proxy.Release();
             }
         }
     }
 }
 public void SetCoordinatorProxy(TwoPhaseCommitCoordinatorProxy proxy)
 {
     if (this.participantService == null)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.FailFast("participantService needed for coordinatorProxy");
     }
     proxy.AddRef();
     this.coordinatorProxy = proxy;
     this.coordinatorProxy.From = this.participantService;
 }
 public void SetCoordinatorProxy(TwoPhaseCommitCoordinatorProxy proxy)
 {
     if (this.participantService == null)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.FailFast("participantService needed for coordinatorProxy");
     }
     proxy.AddRef();
     this.coordinatorProxy      = proxy;
     this.coordinatorProxy.From = this.participantService;
 }
Beispiel #5
0
 private void OnPoliteSendComplete(IAsyncResult ar, TwoPhaseCommitCoordinatorProxy proxy)
 {
     try
     {
         proxy.EndSendMessage(ar);
     }
     catch (WsatSendFailureException exception)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
         DebugTrace.TraceSendFailure(exception);
         this.state.Perf.MessageSendFailureCountPerInterval.Increment();
     }
 }
 public MsgRegisterDurableResponseEvent(CoordinatorEnlistment coordinator, RegisterResponse response, TwoPhaseCommitCoordinatorProxy proxy) : base(coordinator, response, proxy)
 {
     this.coordinator = coordinator;
 }
 public MsgRegisterResponseEvent(CoordinatorEnlistmentBase coordinator, RegisterResponse response, TwoPhaseCommitCoordinatorProxy proxy) : base(coordinator)
 {
     proxy.AddRef();
     this.proxy = proxy;
 }
 public MsgRegisterVolatileResponseEvent(VolatileCoordinatorEnlistment volatileCoordinator, RegisterResponse response, TwoPhaseCommitCoordinatorProxy proxy) : base(volatileCoordinator, response, proxy)
 {
     this.volatileCoordinator = volatileCoordinator;
 }
 public MsgRegisterDurableResponseEvent(CoordinatorEnlistment coordinator, RegisterResponse response, TwoPhaseCommitCoordinatorProxy proxy) : base(coordinator, response, proxy)
 {
     this.coordinator = coordinator;
 }
 public MsgRegisterResponseEvent(CoordinatorEnlistmentBase coordinator, RegisterResponse response, TwoPhaseCommitCoordinatorProxy proxy) : base(coordinator)
 {
     proxy.AddRef();
     this.proxy = proxy;
 }
 public MsgRegisterVolatileResponseEvent(VolatileCoordinatorEnlistment volatileCoordinator, RegisterResponse response, TwoPhaseCommitCoordinatorProxy proxy) : base(volatileCoordinator, response, proxy)
 {
     this.volatileCoordinator = volatileCoordinator;
 }
 private void OnPoliteSendComplete(IAsyncResult ar, TwoPhaseCommitCoordinatorProxy proxy)
 {
     try
     {
         proxy.EndSendMessage(ar);
     }
     catch (WsatSendFailureException exception)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
         DebugTrace.TraceSendFailure(exception);
         this.state.Perf.MessageSendFailureCountPerInterval.Increment();
     }
 }