2011-06-22 61 views
1

問:交易不可用?

當我打電話以下方法:

con.Begin_Transaction(); 

方法實現:

public void Begin_Transaction() 
     { 
      if (this.connection.State == ConnectionState.Open) 
      { 
       this.current_trans = this.connection.BeginTransaction(IsolationLevel.Serializable); 
      } 
     } 

使用下列類:

  DbProviderFactory providerFactory; 
     IfxConnection connection; 
     IfxCommand command; 
     IfxTransaction m_current_trans; 
     IfxParameter param; 
     IfxDataReader DR; 

我得到以下異常:

IBM.Data.Informix.If異常:ERROR [HY000] [Informix的.NET 提供商] [Informix的]交易沒有 提供

什麼請問這裏有問題嗎? 在此先感謝。

+1

你嘗試用另一種交易? –

+1

是否爲數據庫打開了日誌記錄? – V4Vendetta

+0

不好意思,另一種交易是什麼意思? –

回答

4

進行交易操作的數據庫應該是記錄啓用,請檢查其對你的情況做了,在情況下使用,因爲它會需要撤消更改

+0

你是什麼意思的日誌記錄,以及如何確保 –

+1

檢查[this out](http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.sqlt .doc/sqltmst163.htm) – V4Vendetta

+1

這是一個很好的。動態服務器允許你在CREATE DATABASE語句中用WITH LOG子句打開日誌記錄。' 我已經創建了我的數據庫如何允許日誌記錄。 –