Web Service 使用分布式事務出錯(OLE DB provider 'SQLOLEDB'無法啟動分布式事務)
環境: Windows XP SP2、 Sql Server 2000
問題描述:在搭建Web Service時,訪問了遠程數據庫的Link Server(即應用服務器訪問了兩台數據庫服務器),執行SQL語句,如下:
begin transaction
select CNCJ.dbo.Custmoer.TotalVol FROM CNCJ.dbo.Customer c1 left join OrderHeaderID o1 on c1.OrderID = o1.OrderID
WHERE or.CustomerProfileID = '188168' and o1.AggType = 'PPV' and o1.OrderMonth = '200805'
commit tran
go
CNCJ為數據庫服務器上的Link Server。
出錯:
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].
解決辦法:
1. 在數據庫服務器上打開Sql Server的企業管理器,展開,右鍵“Local(Windows NT)”屬性,確定“自動啟動MSTDC”勾上。
2. 管理工具->組件服務->計算機->我的電腦,右鍵屬性,MSTDC選項卡,點擊按鈕“Security Configuration..”,勾上Newwork DTC Access, Allow Remote Clients、Allow Remote Administration、Allow Inbound、Allow Outbound、No Authentication Required、Enable Transaction Internet Protocol(TIP) Transactions、Enable XA Transactions,Account:為NT AUTHORITY/Newwork Service
3. 管理工具->服務->找到Distributed Transaction Coordinator,雙擊,選擇“Log on”選項卡,確保This account為NT AUTHORITY/Network Server。
最後更新:2017-04-02 00:06:46
上一篇:
[示例]存儲過程循環與用戶自定義函數遞歸調用
下一篇:
打造自己的checkinstall
API Demos 2.3 學習筆記 (5)-- Text->LogTextBox
使用JS禁用瀏覽器後退按鈕
Android Manifest.xml文件解析
2017最新鑫眾棋牌源碼:含最新版遊戲大廳+手機版網站+手機端大廳+代理係統+超強後台
應對Memcached緩存失效,導致高並發查詢DB的幾種思路
關於webStrom-11.1配置less且自動生成.css和自動壓縮為.min.css/.min.js
/usr/bin/ld: cannot find -lltdl collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] Err
最完整的網狐棋牌-新手零基礎教程 第五節 大廳源碼的編譯和修改教程
Mysql簡介及概念
手機係統應用開發商有哪些