Why does WCF need DTC for transaction flow?

I wonder why WCF requires that MSDTC is configured and run on both the client and the server when I use the transaction flow. (with network access enabled)

After all, transactions in WCF are managed, although SOAP messages using WsAtomicTransaction ... So, why the hell do two DTCs need to communicate with each other?

Thanks for your reply.

+4
source share
1 answer

Yes, WCF can and will use WS-AtomicTransactions when necessary, mainly in compatibility scenarios (with clients or non-.NET services).

But since so many times - interoperability comes at a price (performance), and if your clients and services are based on Windows, WCF will use OleTransactions (OleTx for simple cases with one long-term storage) or MS-DTC (for more advanced scenarios with several long-lasting ones) storage) - for reasons of performance and simplicity.

Thus, WCF does not need MS-DTC as such, but WCF (and you!) Can benefit from it in Windows-only scripts.

+3
source

Source: https://habr.com/ru/post/1299424/


All Articles