Microsoft SQL Server 2008 (SP1)
試圖創建出象這樣的交易:
OleDbConnection con;
OleDbTransaction transaction = null;
...
transaction = con.BeginTransaction(IsolationLevel.Snapshot);
而得到錯誤:
System.Data.OleDb.OleDbException (0x8004D008): Neither the isolation level nor a strengthening of it is supported. at System.Data.OleDb.OleDbTransaction.ProcessResults(OleDbHResult hr) at System.Data.OleDb.OleDbTransaction.BeginInternal(ITransactionLocal
transaction) at System.Data.OleDb.OleDbConnectionInternal.BeginTransaction(IsolationLevel isolationLevel) at System.Data.OleDb.OleDbConnection.BeginTransaction(IsolationLevel isolationLevel)
我確信在SQL Server Management Studio中運行以下代碼:
ALTER DATABASE mydb SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
ALTER DATABASE mydb SET ALLOW_SNAPSHOT_ISOLATION ON;
ALTER DATABASE mydb SET READ_COMMITTED_SNAPSHOT ON;
ALTER DATABASE mydb SET MULTI_USER;
我錯過了什麼?
:
或者,在開始交易之前執行SQL命令? – Oded 2012-03-15 19:44:39