MVC 3: диспетчеру транзакций MSDTC не удалось получить транзакцию из источника

Я использую MVC 3 с сущностями, теперь я использовал приведенную ниже строку кодов с моего контроллера

<code>        using (var scope = new TransactionScope())
        {
            _myRepository.DeleteFM1(id);
            _myRepository.DeleteFM2(id, name);
            scope.Complete();
        }
</code>

и внутри моегоDeleteFM2 метод, который является моим методом, определенным в классе Entity, выглядит следующим образом:

<code>    public void DeleteFM2(int id, string name)
    {
        var data= _repositoryMD.Fetch().Where(mColl => mColl.Col1 == id);

        if (data!= null)
        {
                //insert here is giving some error MSDTC error !
                // here I prepare a message using the '**data**'
                _repositoryHistory.Insert(name, message, "FM2", "Delete", dateTime);


                _repositoryMD.Attach(data);
                _repositoryMD.Delete(data);
                _repositoryMD.SaveChanges();
            }
        }
    }
</code>

и у меня есть отдельный класс, где я определил метод Insert как

<code>   public bool Insert(string realName, string logMessage, string tableName, string changeType, DateTime dateTime)
    {
        var history = new History
        {
            ModifiedBy = realName,
            ChangeType = changeType,
            DateModified = dateTime,
            LogMessage = logMessage,
            TableName = tableName
        };

        _repositoryHistory.Add(history);
        _repositoryHistory.SaveChanges();

        return true;
    }
</code>

После вставки этой строки кода в вышеупомянутый метод DeleteFM2

<code>      _repositoryHistory.Insert(name, message, "FM2", "Delete", dateTime);
</code>

Я получаю эту ошибку, без этой строки мой код работает нормально, я использовал эту строку и во всех других моих методах, даже там, где я использовал Transaction Scope, но я все еще не понимаю проблему здесь. Пожалуйста помоги. Спасибо

The underlying provider failed on Open.

System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. ---> System.Runtime.InteropServices.COMException: The MSDTC transaction manager was unable to pull the transaction from the source transaction manager due to communication problems. Possible causes are: a firewall is present and it doesn't have an exception for the MSDTC process, the two machines cannot find each other by their NetBIOS names, or the support for network transactions is not enabled for one of the two transaction managers. (Exception from HRESULT: 0x8004D02B) at System.Transactions.Oletx.IDtcProxyShimFactory.ReceiveTransaction(UInt32 propgationTokenSize, Byte[] propgationToken, IntPtr managedIdentifier, Guid& transactionIdentifier, OletxTransactionIsolationLevel& isolationLevel, ITransactionShim& transactionShim) at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken) --- End of inner exception stack trace --- at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken) at System.Transactions.TransactionStatePSPEOperation.PSPEPromote(InternalTransaction tx) at System.Transactions.TransactionStateDelegatedBase.EnterState(InternalTransaction tx) at System.Transactions.EnlistableStates.Promote(InternalTransaction tx) at System.Transactions.Transaction.Promote() at System.Transactions.TransactionInterop.ConvertToOletxTransaction(Transaction transaction) at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts) at System.Data.SqlClient.SqlInternalConnection.GetTransactionCookie(Transaction transaction, Byte[] whereAbouts) at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx) at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx) at System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction) at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)

My FireWall settings

Мои настройки FireWall

Ответы на вопрос(6)

Ваш ответ на вопрос