index > Transactions Programming > Communication with the underlying transaction manager has failed.

Communication with the underlying transaction manager has failed.


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.

armo2006

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

Miguel Gasca - MSFT

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?

armo2006
reply 3

You can use google to search for other answers

 

More Articles

• ITransactionImport::import method error
• promote a transaction to DTC
• (I'm in a hurry) Problems with TransactionScope and MS DTC
• Regarding MS DTC Sample Application
• Working with DTC(Urgent)
• System.Transactions and ADO .NET 1.x IDbTransaction
• Transaction Scope Problem
• Does WCF Can make Transaction With Java Application?
• TransactionScopeOption - what no "Supports"?
• ServicedComponent shared Transaction
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

• promote a transaction to DTC
• TransactionScope authentication / poorly
• how to implement behaviour similar to Tr
• Distributed transaction support in wcf u
• MSDTC problems
• Sqlite with transactions ?
• System.Transaction sealed or not?
• COM transactions broken after performanc
• enter "this user" everyday
• local transaction inside transaction scope
• Transaction Scope with datatable updates
• Lightweight transactions vs. Connection
• Working with DTC(Urgent)
• Calling "transactional web services
• Interoperability with Sun/Oracle/Fujitsu

Hot Articles

• Transaction Scope with datatable updates
• UnauthorizedAccessException = Error acce
• Transaction Scope Problem
• Missing Commit
• Using IProcessInitializer
• ServicedComponent SQLServer and Oracle10
• TransactionScope fails
• How to detect when a Compensating Resour
• Com+ Error
• TransactionScope with sql and msmq
• Dot Net Distributed Application by using
• will SetAbort() rollback transactions ev
• COM transactions broken after performanc
• Asynchronous Pattern for COM+ Serviced C
• [SysTx] Why do two connections get promo

Recommend Articles

• UnauthorizedAccessException when using M
• Benchmarks/Overhead with WS-AT
• Configuring MSDTC on Client PCs
• enter "this user" everyday
• "Error when enlisting in a distribu
• will SetAbort() rollback transactions ev
• Transactional Resource Manager
• Does WCF Can make Transaction With Java
• local transaction inside transaction scope
• DTC help
• MSDTC, distributed applications and XA c
• RE: Windows COM+ Advice (",))
• ServicedComponent shared Transaction
• TransactionScope authentication / poorly
• Tiny question about MSDTC behaviour