当 TransactionScope 升级到 DTC 时,.net 4.0 中的场景发生了哪些变化?
有人可以详细说明 .net 4 中针对 TransactionScope 将(或不会)升级为 DTC 的情况所做的更改吗?还是一切都和3.5一样?
Can someone detail the changes made in .net 4 to the circumstances under which TransactionScope will (and will not) escalate to DTC? Or is everything the same as 3.5?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我找不到任何有关更改的文档(在我自己寻找一些文档时找到了此线程),但确实有一些有趣的事情发生了变化。
我们有一个 .Net 3.5 应用程序,其中包含大约 100 个使用 TransactionScope 的单元测试。我的团队允许远程办公,我发现无论我做什么,当我通过 VPN 远程工作时,这些测试都会失败。当地与他们没有任何问题。我之前所做的研究表明,VPN 上的 DTC 存在一些问题,但不值得深入研究。
不过,我们上个月将该项目升级到了 .Net 4.0,从那时起,我通过 VPN 进行的这些测试就没有遇到任何问题。我不否认,可能是我们的 VPN 发生了变化,但时间至少非常巧合。
I can't find any documentation about changes (found this thread as I was looking for some myself), but it sure seems anecdotally that something that changed.
We had a .Net 3.5 app with about 100 unit tests that used TransactionScope. My team allows telecommuting, and I found that no matter what I did, these tests failed when I was working remotely, over VPN. Had no issues with them locally. Previous research I'd done indicated there were some issues with DTC over VPN, but it wasn't worth the hassle of digging deeper.
However, we upgraded the project to .Net 4.0 last month and since then I've had no issues with these tests over VPN. Could be a change in our VPN, I don't deny, but the timing is at least very coincidental.
MSDN 上的任何地方都没有列出它已被更改,所以我想说它是相同的。
This is not listed anywhere on MSDN as having been changed so I'm going to say it's the same.
据我所知,没有这样的变化。为什么微软会破坏数千个使用 TransactionScope 的项目?也许您误解了某些内容(或者您正在阅读的源代码不准确),因为并非每个 dbms 都有 TransactionScope 的支持,在这种情况下,TS 就成为分布式事务。
PS 抱歉我的英语:-)
As far as I can tell, there is no such changes. Why MS would break thousands of project which are using TransactionScope? Maybe you misunderstood something (or the source you were reading was not accurate), as not every dbms has TransactionScope's support and in that case, TS becomes a distributed transaction.
P.S. Sorry for my English :-)