In .Net, is there any way to determine whether the ambient transaction is DTC transaction or not when debugging. I investigated SqlConnection class members but I found nothing. thanks.
Click Start, click Run, type cmd, and then click OK. Type net stop msdtc , and then press ENTER. Type net start msdtc , and then press ENTER.
The Microsoft Distributed Transaction Coordinator (MSDTC) service is a component of modern versions of Microsoft Windows that is responsible for coordinating transactions that span multiple resource managers, such as databases, message queues, and file systems.
I prefer to check the DistributedIdentifier Property.
In the immediate window while debugging type:
System.Transactions.Transaction.Current.TransactionInformation.DistributedIdentifier
If the value is Guid.Empty {00000000-0000-0000-0000-000000000000} then it is not a distributed transaction (the documentation says null but this is wrong since it is not a nullable type). Any other Guid value indicates that the transaction has been promoted to a distributed transaction.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With