locked
Communication with the underlying transaction manager has failed.

    Question

  • Does anyone know how to resolve this exception.

    Exception:

    Message: Communication with the underlying transaction manager has failed.

    Stack Trace:

    System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. ---> System.Runtime.InteropServi

    ces.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.

     

       at System.Transactions.Oletx.IDtcProxyShimFactory.ReceiveTransaction(UInt32 p

    ropgationTokenSize, Byte[] propgationToken, IntPtr managedIdentifier, Guid& tran

    sactionIdentifier, OletxTransactionIsolationLevel& isolationLevel, ITransactionS

    him& transactionShim)

     

       at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterP

    ropigationToken(Byte[] propagationToken)

       --- End of inner exception stack trace ---

     

       at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterP

    ropigationToken(Byte[] propagationToken)

     

       at System.Transactions.TransactionStatePSPEOperation.PSPEPromote(InternalTran

    saction tx)

     

       at System.Transactions.TransactionStateDelegatedBase.EnterState(InternalTrans

    action tx)

     

       at System.Transactions.EnlistableStates.Promote(InternalTransaction tx)

     

       at System.Transactions.Transaction.Promote()

     

       at System.Transactions.TransactionInterop.ConvertToOletxTransaction(Transacti

    on transaction)

     

       at System.Transactions.TransactionInterop.GetExportCookie(Transaction transac

    tion, 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 transa

    ction)

     

       at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transacti

    on transaction)

     

       at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection ownin

    gObject)

     

       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection ow

    ningConnection)

     

       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection ou

    terConnection, DbConnectionFactory connectionFactory)

     

       at System.Data.SqlClient.SqlConnection.Open()

     

    …. <<details about my code >>….

    Client machine config

    XP Pro with SP2

    Visual Studio 2005

     

    DTC configured to allow network access

    1. Client and Administration Options [Allow Remote Clients and Allow Remote Administration] are checked

    2. Transaction Managed Communication Options [Allow Inbound and Allow Outbound] are checked

    3. Choose the option “No Authentication Required”

    4. Enable Transaction Internet Protocol [TIP] Transactions

    5. Enable XA Transactions.

     

    Server machine config

    Windows 2000 with SP4

    SQL Server 2005

     

     

    Model:

    Client calls an object, say ObjA, which creates a Transaction Scope and calls a method on another object, say ObjB. ObjB creates a transaction scope with "transaction required" option, inserts a row into a SQL 2005 table and sets the scope complete. {Note: Up to this step code works just fine, No DTC involved}. Then ObjA inserts a record into another SQL 2005 table. The SQL 2005 tables are on the same server and same database. At this point the ObjA code throws an exception when try to open the connection. 

     

      

    In order to take advantage of System.Transaction.TransactionScope, does the SQL Server 2005 installed on Windows 2003 server? [DTC version dependency]

     

    IMPORTANT: Applied all the latest security patches from MS to the client [XP] and server [Win 2000] machine. Code works just fine on the local SQLExpress database.

     

    Thanks.

    Thursday, June 01, 2006 9:30 PM

Answers

  • Hey Armo,

    MSDTC will need to be allowed through any firewalls on both machines as will port 134 (the RPC endpoint mapper). Check to make sure these things are setup properly and let me know if it's still failing.

    To expand on what is happening here:
    As you mentioned, this isn't thrown until after you attempt to open the second connection.  SqlClient uses the Transaction Management Escalation feature of System.Transactions when dealing with Sql 2005 (also known as PromotableSinglePhaseEnlistment).  During the first connection the Commit of the Transaction is delegated to the escalateable enlistment (i.e. to SQL and its internal Transaction), so msdtc is not involved.  When you attempt to open the second connection, SqlClient takes an action that forces us to escalate, or promote the management of the Transaction to msdtc.  In doing so, we ask SQL to promote its internal Transaction to an msdtc Transaction.  Sql does so on the server side and return to us on the client side a marshalled version of the msdtc Transaction.  The last frame you see on the call stack of the exception is System.Transaction attempting to use this to Receive the Transaction from the server side.  This requires us to communicate with the msdtc instance on the server machine.  I beleive the firewall is preventing that and thus the TransactionManagerCommunicationException.

    hth,
    Miguel

    Friday, June 02, 2006 11:37 PM
  • Had the same "Communication with the underlying transaction manager has failed" error.  The eventlog had:

    The local MS DTC detected that the MS DTC on xxx-xxxx-xxxx has the same unique identity as the local MS DTC. This means that the two MS DTC will not be able to communicate with each other. This problem typically occurs if one of the systems were cloned using unsupported cloning tools. MS DTC requires that the systems be cloned using supported cloning tools such as SYSPREP. Running 'msdtc -uninstall' and then 'msdtc -install' from the command prompt will fix the problem. Note: Running 'msdtc -uninstall' will result in the system losing all MS DTC configuration information.

     


    Both problems were solved by "msdtc -uninstall" followed by a reboot followed by "msdtc -install". 



    Friday, February 20, 2009 6:19 PM

All replies

  • Hey Armo,

    MSDTC will need to be allowed through any firewalls on both machines as will port 134 (the RPC endpoint mapper). Check to make sure these things are setup properly and let me know if it's still failing.

    To expand on what is happening here:
    As you mentioned, this isn't thrown until after you attempt to open the second connection.  SqlClient uses the Transaction Management Escalation feature of System.Transactions when dealing with Sql 2005 (also known as PromotableSinglePhaseEnlistment).  During the first connection the Commit of the Transaction is delegated to the escalateable enlistment (i.e. to SQL and its internal Transaction), so msdtc is not involved.  When you attempt to open the second connection, SqlClient takes an action that forces us to escalate, or promote the management of the Transaction to msdtc.  In doing so, we ask SQL to promote its internal Transaction to an msdtc Transaction.  Sql does so on the server side and return to us on the client side a marshalled version of the msdtc Transaction.  The last frame you see on the call stack of the exception is System.Transaction attempting to use this to Receive the Transaction from the server side.  This requires us to communicate with the msdtc instance on the server machine.  I beleive the firewall is preventing that and thus the TransactionManagerCommunicationException.

    hth,
    Miguel

    Friday, June 02, 2006 11:37 PM
  • Thanks Miguel. 

    Configured the DTC as described in the technical artical,
     
     http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndcom/html/msdn_dcomfirewall.asp

    and as in the Component Services help
     Component Services -> Help -> Component Services Administration Help
      -> Administering Distributed Trasnactions -> Distributed Transaction Administration Tasks
       -> Configuring MS DTC -> Configuring MS DTC to work Through a Firewall

    These documents recommend to use the port id 135. However it works on both 134 and 135 [the RPC endpoint mapper].

    On the server, configured the RPC, HKEY_LOCAL_MACHINE\Software\Microsoft\Rpc\Internet

    Name                                   Type                        Value  
    -----------------------                 --------------              ----------
    Ports                                    REG_MULTI_SZ  3000-4000
                                                                                 134
    PortsInternetAvailable       REG_SZ                 Y
    UseInternetPorts                REG_SZ                 N

    Note: firewall is off on the client.

    It works just fine now.

    Question, the Internet-accessible ports pose any security risk? How to mitigate them?

    Saturday, June 03, 2006 3:03 PM
  • Miguel,

    In your reply on 6/2/2006 you said,

    "Check to make sure these [firewall settings on both the client machine and the server] are setup properly..."

    I am having a similar problem like Armo has described, with a few differences.  My client machine (and developer machine) is a Windows XP Pro machine with SP2 installed.  The server with the databases on them is a Windows Server 2003 with SQL Server 2005 on it.  However, the domain is a Windows 2000 Active Directory domain.  I found a blog by Florin Lazar titled XP SP2 and Transactions which described how to set up the security configuration on the MS DTC tab in Component Services on my machine.  I've tried to do this, and I think I've done it correctly.  It did take care of an error that I was getting earlier, which was,

    "Network access for Distributed Manager (MSDTC) has been disabled.  Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administratve tool."

    However, now I am getting a different error, which says:

    "Communication with the underlyning transaction manager has failed."

    I have checked the firewall settings on my PC, and the Windows Firewall is turned off.  I've checked the server I'm running against (a test server), and it doesn't look to me as though it is turned on there, either.  The message it gives is:

    "Windows Firewall cannot run because the Windows Firewall/internet Conenction Sharing (ICS) service is not running..."

    So, if you (or anyone else) is still reading this thread, what would you suggest that I do now, please?

     

    Tuesday, October 24, 2006 8:49 PM
  • Rod,

    this article and the one you mentioned might help you: http://blogs.msdn.com/florinlazar/archive/2005/09/16/469064.aspx. Verify the situation with dtcping.

    Friday, October 27, 2006 2:00 PM
  • eglasius,

    Thank you for the information.  I have not heard of DTCPing before, so I will check it out.

    Rod

     eglasius wrote:

    Rod,

    this article and the one you mentioned might help you: http://blogs.msdn.com/florinlazar/archive/2005/09/16/469064.aspx. Verify the situation with dtcping.

    Friday, October 27, 2006 2:17 PM
  •  

    I tried some option as I was also facing same problem on Window XP operating system.

    First of all swithced off firewall and allowded the all ICMP option from advance option.

    Second thing that I did

    >>Administrative Tools>>Component Services>> Computers>> Right Click>> Prpoerties.

    From here i checked all the follwing options:

    1 Allow inbound

    2 allow outbound

    3 allow remote clients

    4 Allow remote administration

    5 Enable TIP transactions.

    6 Enable XA transaction

     

    After all i restarted MSDTC and it was working fine

     

    Regards

    Kamal Thakur

     

    Thursday, November 09, 2006 9:22 AM
  • This might help:

     

    After searching over the internet, I have changed the security configuration of MSDTC to:

    Check

    • "Network DTC Access",
    •  "Allow Remote Clients",
    • "Allow Remote Administration",
    • "Allow Inbound", "Allow Outbound",
    • "No Authentication Required",
    • "Enable Transaction Internet Protocal Transactions",
    • "Enable XA Transaction"

    but still have the same error.

     

    After a few days of desperation, I decided to ruin everything: do whatever I want to the settings. So I unchecked "Enable Transaction Internet Protocal Transactions" and  "Enable XA Transaction", and it works!!!

     

    Thursday, May 01, 2008 4:12 AM
  • I have the exact same error message.
    This was working great and all of sudden stopped working -
    At first I thought it was because of the 'auto updates', so we uninstalled them.
    I then verified setting with another server that is working, restarted the MSDTC.
    Then uninstalled and reinstalled msdtc and had the same issues.
    Any other help would be greatly appreciated.

    We had it working fine last week, but just stopped....

    Tuesday, November 18, 2008 12:30 AM
  • Hi guys,

     

    Check this link it really helped me in solving the problem after 2 days of real hard work finally i got it.

     

    http://msdn.microsoft.com/en-us/library/aa561924.aspx

     

    Please follow the steps given in the link and i got it at the end by the registry steps....

     

    Happy coding,

    vamshi

     

    Thursday, November 20, 2008 9:08 AM
  • Had the same "Communication with the underlying transaction manager has failed" error.  The eventlog had:

    The local MS DTC detected that the MS DTC on xxx-xxxx-xxxx has the same unique identity as the local MS DTC. This means that the two MS DTC will not be able to communicate with each other. This problem typically occurs if one of the systems were cloned using unsupported cloning tools. MS DTC requires that the systems be cloned using supported cloning tools such as SYSPREP. Running 'msdtc -uninstall' and then 'msdtc -install' from the command prompt will fix the problem. Note: Running 'msdtc -uninstall' will result in the system losing all MS DTC configuration information.

     


    Both problems were solved by "msdtc -uninstall" followed by a reboot followed by "msdtc -install". 



    Friday, February 20, 2009 6:19 PM
  • Hi Isidore,

    Are you having the same issue than the one described on the top of this thread by armo2006? Could you give us more details? whic OS versions are involved?

     

    Thanks

     


    Rafael Barcelos - SDET Transactions/Agreements Team
    Monday, August 16, 2010 5:25 PM
    Moderator
  • Disabling my firewall fixed this issue for me. Not a great solution but it worked.

    C#, ASP.NET San Diego, California programmer
    Friday, December 10, 2010 8:40 PM
  • Rafeal, Isidore is just a spam bot, look at the quoted HTML, there is a hidden seo link edded to the word "situation".

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Tuesday, February 15, 2011 8:41 PM
  • user gdgdgeeeee is another seo spam bot with the hidden link on "fitness".

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Tuesday, March 08, 2011 3:57 AM
  • Hey Armo,

    MSDTC will need to be allowed through any firewalls on both machines as will port 134 (the RPC endpoint mapper). Check to make sure these things are setup properly and let me know if it's still failing.

    To expand on what is happening here:
    As you mentioned, this isn't thrown until after you attempt to open the second connection.  SqlClient uses the Transaction Management Escalation feature of System.Transactions when dealing with Sql 2005 (also known as PromotableSinglePhaseEnlistment).  During the first connection the Commit of the Transaction is delegated to the escalateable enlistment (i.e. to SQL and its internal Transaction), so msdtc is not involved.  When you attempt to open the second connection, SqlClient takes an action that forces us to escalate, or promote the management of the Transaction to msdtc.  In doing so, we ask SQL to promote its internal Transaction to an msdtc Transaction.  Sql does so on the server side and return to us on the client side a marshalled version of the msdtc Transaction.  The last frame you see on the call stack of the exception is System.Transaction attempting to use this to Receive the Transaction from the server side.  This requires us to communicate with the msdtc instance on the server machine.  I beleive the firewall is preventing that and thus the TransactionManagerCommunicationException.

    hth,
    Miguel

    Thanks!

    This worked great for me, I do however find it important to mention that one should open the INCOMING 135 port, I opened my outgoing ports and that didn't work and caused quite a bit of frustration until I read an article that mentioned opening incoming ports..

    Thursday, May 19, 2011 8:19 PM
  • hi

    i am also facing the same problem you describe. i also solve this way .

    Both problems were solved by "msdtc -uninstall" followed by a rebootfollowed by "msdtc -install". 

    but the "Communication with the underlying transaction manager has failed " error has still occur. how can i solve it?

    I use Windows 7 Enterprise .

    cheers...

    ZAR NI MG


    • Edited by Zar Ni Mg Monday, April 02, 2012 11:27 AM
    Saturday, March 31, 2012 7:29 AM