Distributed Transaction With MS OLEDB Provider For Oracle
0 |
在SQL Server上設了Linked Server連到Oracle,卻發現T-SQL加上BEGIN TRAN後會傳回以下錯誤:
The operation could not be performed because OLE DB provider "MSDAORA" for linked server "MyOra" was unable to begin a distributed transaction.
做了許多嘗試,得到以下結論:
- Linked Server使用的是Microsoft OLE DB Provider For Oracle
- 使用.NET 2.0 TransactionScope包System.Data.OracleClient.OracleConenction可以支援MTS
- 用ASP加<%@ TRANSACTION=Required %>測試,用Oracle的OLEDB Driver(Provider=OraOLEDB.Oracle)可以支援MTS,用MS版的OLEDB(Provider=MSDAORA)則是失敗收場
最後由ASP的錯誤訊息8000048找到了一個關鍵字GetXaSwitch,讓我想到去檢查MSDTC的設定,果然發現有個Enable XA Transactions選項沒有被勾選。啟用後,一切OK,哈里路亞!
Comments
Be the first to post a comment