在SQL Server的连接字符串中,Enlist = false是什么意思? [英] what is Enlist=false means in connection string for sql server?
问题描述
我是.net的初学者。我遇到以下错误的问题
I am a beginner with .net. I faced issue with the following error
无法执行事务操作,因为有正在处理的未决请求。。
"The transaction operation cannot be performed because there are pending requests working on this transaction.".
我在博客的某处阅读。我在连接字符串后附加了 enlist = true
并且问题已解决。
i read somewhere in the blog .i appended my connection string with enlist=true
and the issue was resolved.
注意:我正在将数据库从sql server 2005升级到sql server 2008R2。
Note: i am upgrading my DB from sql server 2005 to sql server 2008R2.
请帮助了解使用登记的重要性。
Please help to understand the importance of using enlist.
推荐答案
登记是用户的分布式事务
如果Connection对象确定某个事务处于活动状态,它将自动加入现有的
分布式事务中。
打开连接
或从连接池中检索连接时,将发生自动事务登记。您可以通过将Enlist = false
指定为SqlConnection的连接
字符串参数来禁用现有事务中的自动登记
,或者OLE DB Services =- 7作为OleDbConnection的
连接字符串参数。
The Connection object will automatically enlist in an existing distributed transaction if it determines that a transaction is active. Automatic transaction enlistment occurs when the connection is opened or retrieved from the connection pool. You can disable auto-enlistment in existing transactions by specifying
Enlist=false
as a connection string parameter for a SqlConnection, or OLE DB Services=-7 as a connection string parameter for an OleDbConnection.
注意连接必须为 open
,然后调用 EnlistDistributedTransaction
。
Note The Connection must be open
before calling EnlistDistributedTransaction
.
这里是一个示例 Enlist = False;
Here is an example for you with Enlist=False;
这篇关于在SQL Server的连接字符串中,Enlist = false是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!