Search code examples
.nettransactionsmsdtc

Why should I use transaction over MSDTC instead of System.Data.SqlClient.SqlTransaction?


Assuming I am using only one sql server database

Why would one choose transaction over MSDTC instead of SqlTransaction?

My feeling is there is some sort of "obviousness" choosing msdtc over SqlTransactions that I can't figure...


Solution

  • MSDTC allows you to transact across multiple resources, like multiple SQL Servers plus web services (over WS-Transaction) + Transactional NTFS + MSMQ + ... all in one transaction with one atomic commit.

    It comes with a performance and availability cost though.