閱讀376 返回首頁    go 阿裏雲 go 技術社區[雲棲]


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

  上一篇:go [示例]存儲過程循環與用戶自定義函數遞歸調用
  下一篇:go 打造自己的checkinstall