为什么WCF需要DTC来进行事务流?

发布于 2024-08-19 01:24:46 字数 161 浏览 4 评论 0原文

我想知道当我使用事务流时,为什么 WCF 需要在客户端和服务器上配置并启动 MSDTC。 (启用网络访问)

毕竟,WCF 中的事务是使用 WsAtomicTransaction 通过 SOAP 消息进行管理的... 那么到底为什么两个 DTC 需要相互通信呢?

感谢您的回复。

I wonder why WCF needs MSDTC configured and started on both client and server, when I use transaction flow. (with network access enabled)

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

Thanks for your response.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

看透却不说透 2024-08-26 01:24:46

是的,WCF 可以并且将会在适当的时候使用 WS-AtomicTransactions - 主要是在互操作性场景中(与非 .NET 客户端或服务)。

但很多时候 - 互操作性是以(性能)为代价的,如果您的客户端和服务都是基于 Windows 的,WCF 将选择使用 OleTransactions(OleTx 用于只有一个持久存储的简单情况)或 MS-DTC(更多涉及多个持久存储的高级场景) - 出于性能和简单性的原因。

因此,WCF 本身需要 MS-DTC - 但 WCF(和您!)可以在仅限 Windows 的场景中受益。

Yes, WCF can and will use WS-AtomicTransactions, when appropriate - mostly in interoperability scenarios (with non-.NET clients or services).

But as so many times - interoperability comes at a (performance) price, and if your clients and services are all Windows based, WCF will opt to use OleTransactions (OleTx for simple cases with just one durable store) or MS-DTC (for more advanced scenarios with multiple durable stores involved) - for performance and simplicity reasons.

So WCF doesn't need MS-DTC per se - but WCF (and you!) can benefit from it in Windows-only scenarios.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文