SqlClient.SqlTransaction与System.Transactions [英] SqlClient.SqlTransaction vs System.Transactions

查看:108
本文介绍了SqlClient.SqlTransaction与System.Transactions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在设置 MSDTC 时经常遇到一些问题,现在考虑将SystemTransactions替换为SqlTransactions.

We have some constant issues with MSDTC setting up, now considering replacing SystemTransactions with SqlTransactions.

我对上述区别以及我们可能遇到的问题感兴趣.

I am interested in differences of the above, and possible issues we might have doing that.

推荐答案

由Massimiliano引用和引用的文章在引用时已有7年的历史,因此仅引用.NET 2.0和SQL Server 2000和2005.但是,我相信显着点仍对更高版本有效.我无法找到对以后版本中的任何更改都直接适用的评论.

The article quoted and referenced by Massimiliano was 7 years old when referenced and therefore refers only to .NET 2.0 and SQL Server 2000 and 2005. However, I believe the salient points are still valid for later versions. I'm having trouble finding directly applicable commentary on any changes in later versions.

似乎在SQL Server 2008和更高版本中,与旧版本相比,针对单个数据库的System.TransactionScope事务不太可能被提升为DTC.

It does seem that in SQL Server 2008 and later System.TransactionScope transactions against a single database are less likely to be promoted to DTC than under older versions.

相关: SqlClient,系统.事务,SQL Server 2008和MARS

因此,根据您的SQL Server版本,您将对单个数据库使用System.Transactions解决DTC问题.

So depending on you SQL Server version you will have more or less trouble with DTC using System.Transactions against a single database.

System.Transactions的代码比SqlTransactions的代码轻,但处理开销更高,显式控件更少.

The code for System.Transactions is lighter than for SqlTransactions, but the processing overhead is higher and you have less explicit control.

这篇关于SqlClient.SqlTransaction与System.Transactions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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