Skip to main content
 首页 » 编程设计

c#之交易不可用

2024年02月23日1952php

问:

当我调用以下方法时:

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 Exception: ERROR [HY000] [Informix .NET provider][Informix]Transaction not available

请问这里有什么问题? 提前致谢。

请您参考如下方法:

要使事务正常工作,数据库应该启用日志记录,请检查它是否已针对您的情况完成,在需要撤消更改的情况下使用