是否需要TransactionScope的DTC服务上? [英] Does TransactionScope Need DTC Service on?

查看:311
本文介绍了是否需要TransactionScope的DTC服务上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我在读什么,为了在.NET中使用的TransactionScope,你需要在Windows Distributed Transaction Coordinator服务正在运行。我有一个服务的关闭,然后我的应用程序似乎是运行相同并回滚事务没有问题。

From what I'm reading, in order to use TransactionScope in .NET, you need the Distributed Transaction Coordinator service in Windows to be running. I have that service turned off, and my app seems to be running the same and rolls back transactions no problem.

我缺少的东西吗? 如何是它能够工作吗我运行Windows 7和运行web应用程序关闭的VisualStudio 2010

Am I missing something? How is it able to work? I'm running Windows 7 and running the webapp off VisualStudio 2010.

感谢。

推荐答案

窗口的更先进的版本在内核中的迷你版本的DTC。它不分配,但使用相同的API - 但它只能处理每笔交易范围1的ressource

More modern versions of windows have a mini DTC version in kernel. It is not distributed but uses the same API - but it can only handle one ressource per transaction scope.

TransactionScope的使用,在一开始,然后是促进交易到真正的DTC的那一刻添加第二个资源(在你的案件资源是一个数据库连接)。所以,只要你的使用情况是ismple,避免DTC分布式部分(高)开销,并且可以在不运行服务工作。

TransactionScope uses that at a start, then "promotes" the transaction to the real DTC the moment a second resource is added (resource in your case is a database connection). So, as long as your use case is ismple, you avoid the (high) overhead of the DISTRIBUTED part of DTC and can work without the service running.

有关内核事务Managger更多信息可以在 http://en.wikipedia.org/wiki找到/ Kernel_Transaction_Manager

More information about the Kernel Transaction Managger can be found at http://en.wikipedia.org/wiki/Kernel_Transaction_Manager

MS加也因为NTFS了交易,并需要确保一个DTC是aavailable。

MS added it also because NTFS got transactional and it needed to make sure a DTC is aavailable.

HTTP://www.$c$cguru.com/cpp /article.php/c18309/

这篇关于是否需要TransactionScope的DTC服务上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆