Trace why a transaction is escalated to DTC

2019-06-15 06:45发布

问题:

Is there any way to determine precisely why a System.Transaction TrasactionScope is being escalated to the DTC? We are hitting a bump with one of our components that seem to escalate the transaction while all other components (which seem deceptively similar) does not do escalation.

Are any information made available on the reasons for the escalation and how can they be found and observed? SQL Profiler? Log files? Or am I out of luck on this one?

UPDATE: I'm running against SQL Server 2005 for info

回答1:

You could try shutting down the Distributed Transaction Cordinator service and setting its startup type to disabled. This will cause an exception when the transaction is promoted that will have the problem code in the call stack.

Of course this won't help if you have other items running on the machine that require this service, but would be possible on a debug machine.



回答2:

When using TransactionScope a transaction is escalated whenever application opens a second connection (even to the same database) within the Transaction Scope in question.