TransactionScope的:它是否变得更好? [英] TransactionScope: Has it gotten better?

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

问题描述

在TransactionScope的第一个走了出来,我跑进得到它我开发计算机(XP)和我们的数据库服务器(Windows Server 2003)的工作,一些严重的问题。

When TransactionScope first came out, I ran into some serious issues getting it to work between my dev machine (XP) and our database server (Windows Server 2003).

当我看着它多,这似乎是一个棘手和wides $ P $垫的问题是有成为生产中头疼的一个机会,所以我决定不处理事务这种方式(即使我喜欢的语法了很多,我真的很想它的工作)。

When I looked into it more, this appeared to be a tricky and widespread issue that had a chance of becoming a headache in production, so I decided not to handle transactions this way (even though I like the syntax a lot and I really wanted it to work).

难道这些问题仍然在那里,或者这是安全使用?你用这个规律现在没有问题?

Are these problems still out there or is this safe to use? Do you use this regularly now without issues?

非常感谢!

注意:这已经很长一段时间了,但我认为这个问题必须是与分发事务处理协调器。我摆弄了很长一段时间,并没有能够得到它的工作。

Note: It has been a long time now, but I think the issue had something to do with Distribute Transaction Coordinator. I fiddled with it for a long time and was never able to get it working.

推荐答案

里克施特拉尔大约有交易的范围和LINQ to SQL的此处。它的背景更加的LINQ to SQL,但我认为有一些应用,可以帮助你解决你的问题的一些原则。

Rick Strahl has a great post about transaction scope and LINQ to SQL here. Its context is more LINQ to SQL, but I think that there are some principles that apply which could help you solve your question.

编辑:更具体回答你的问题,这里就是施特拉尔不得不说的TransactionScope的:

to more specifically answer your question, here's what Strahl has to say about TransactionScope:

传统的TransactionScope是分布式事务处理协调器(DTC)围绕.NET包装,但它的功能也有所扩大。其中值得关注的是,DTC是相当昂贵的资源使用方面,它要求DTC服务实际上是在机器上运行(另一种服务,这是特别令人烦恼的客户端安装)。

Traditionally TransactionScope was a .NET wrapper around the Distributed Transaction Coordinator (DTC) but it’s functionality has expanded somewhat. One concern is that the DTC is rather expensive in terms of resource usage and it requires that the DTC service is actually running on the machine (yet another service which is especially bothersome on a client installation).

不过,最新更新的TransactionScope和SQL Server客户端驱动程序使之可以使用TransactionScope类和易用性提供无需DTC只要你对​​一个单一的数据库,并与一个一致的连接字符串运行

However, recent updates to TransactionScope and the SQL Server Client drivers make it possible to use TransactionScope class and the ease of use it provides without requiring DTC as long as you are running against a single database and with a single consistent connection string

这篇关于TransactionScope的:它是否变得更好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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