【问题标题】:transaction not available?交易不可用?
【发布时间】:2011-06-22 09:27:11
【问题描述】:

问:

当我调用以下方法时:

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 异常:错误 [HY000] [Informix .NET 提供者][Informix]事务不 可用

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

【问题讨论】:

  • 您是否尝试过另一种交易方式?
  • 数据库的日志记录是否开启?
  • 请问,另一种交易是什么意思?
  • 是的,我正常连接到数据库。连接状态是open
  • @just_name 尝试更改 InsolationLevel

标签: c# asp.net transactions informix


【解决方案1】:

为了使事务正常工作,数据库应该启用日志记录,请检查它是否适合您的情况,在需要撤消更改时使用它

【讨论】:

  • 检查this out
  • 这太棒了。Dynamic Server allows you to turn on logging with the WITH LOG clause in the CREATE DATABASE statement.我已经创建了我的数据库如何允许记录。
  • ontape -s [-A database_list] [-B database_list]
  • 我认为ontape 是一个实用程序。也许你可以试试This
  • 非常感谢,这解决了我的问题。在 informix 或其他 DBMS 中创建数据库期间是否必须澄清logging。因为我从来没有在sql server 中遇到过这种情况。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-10-07
  • 1970-01-01
  • 1970-01-01
  • 2011-01-21
相关资源
最近更新 更多