中国开发网: 论坛: 程序员情感CBD: 贴子 98758
Miracle: 好久没开张了,问个技术问题,MS DTC/SQL Server达人请进来
假设我现在有2台SQL Server (Windows Server 2003 + SQL Server 200 sp3),分别叫DB01和DB02,互相信任,互相把对方加入了Linked Servers的列表,常规访问无任何问题,但是无法启用分布式事务,例子如下:

在DB01上运行下列SQL命令:

begin tran

select top 1 * from item

select top 1 * from db02.production.dbo.item

rollback tran

在第2个select语句处提示The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransaction returned 0x8004d00a].

把begin tran换成BEGIN DISTRIBUTED TRANSACTION,结果相同。

在这2台服务器上,已经同时启用了MS DTC服务,并在Component Service中设定了MS DTC各种安全支持选项全开(步骤如下:

1. Click Start, point to All Programs, point to Administrative Tools, and click Component Services.
2. In the Component Services console, expand Component Services, expand Computers, right-click My Computer, and then click Properties.
3. In the My Computer Properties dialog box, on the MSDTC tab, click Security Configuration.
4. In the Security Configuration dialog box, select the Network DTC Access check box, select the Network Administration check box, select the Network Transactions check box, select the Network Clients check box, select the Transaction Internet Protocol (TIP) Transaction check box, and then click OK.
5. Restart the computer.
)。

是什么原因导致无法启动事务呢?
夫习拳艺者,对已者十之七八,对人者,仅十之二三耳。拳艺之道,深无止境。得其浅者,一人敌,得其深者,何尝不万人敌耶!
我的Google Picasa相册
我的新BLOG

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录