由于相同的连接字符串建立多个连接下单成交,成交升高? [英] Multiple Connections With Same Connection String Under A Single Transaction, Elevated Transaction?

查看:173
本文介绍了由于相同的连接字符串建立多个连接下单成交,成交升高?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用ado.net,并创建一个单一的事务中的多个连接到MS SQL Server数据库(使用System.Transactions.TransactionScope),并System.Transactions的提升从轻量级事务管理器的事务的分布式事务协调器(内核在Vista上的事务协调人),即使在连接字符串是相同的所有连接的对象?

When using ado.net, and creating multiple connections to a MS SQL Server database within a single transaction (using System.Transactions.TransactionScope), does System.Transactions elevate the transaction from the lightweight transaction manager to the distributed transaction coordinator (kernel transaction coordinator on Vista), even if the connection strings are the same for all of the connection objects?

该文档是在这个特定的情况有些模糊。它说,如果其它连接打开到服务器的事务期间的交易将得到提升,但它并没有说如果这样做,所有的时间或仅在连接字符串是不同的。它没有任何意义,我认为这会提升交易如果连接字符串是一样的,但如果这样做,基本上使得轻量级事务管理器完全无用,海事组织。

The documentation is somewhat ambiguous on this specific situation. It says the transaction will get elevated if another connection is opened to the server during the transaction but it doesn't say if it does that all the time or only if the connection string is different. It doesn't make sense to me that it would elevate the transaction if the connection string is the same, but if it does, it basically makes the lightweight transaction manager completely useless, IMO.

推荐答案

在目前的版本中,它始终提升了交易,很遗憾。

In the current version it always elevates the transaction, unfortunately.

正如你说的,做的TransactionScope少了很多有用的比它,否则会。我相信,有计划改变这一在未来的版本。

Which as you say, makes TransactionScope a lot less useful than it otherwise would be. I believe there are plans to change this in a future version.

这篇关于由于相同的连接字符串建立多个连接下单成交,成交升高?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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