【问题标题】:Informix XA Driver in Play! Framework applicationInformix XA 驱动程序正在运行!框架应用
【发布时间】:2011-01-04 10:32:24
【问题描述】:

我正在尝试将 Informix 数据库与 Play! 一起使用!框架应用。我是 Informix 的新手。

我的 Windows 机器上安装了 Informix 11.70,并且正在运行 Play 1.1。

在游戏中!你可以像这样指定你的数据库连接:

db.url=jdbc:informix-sqli://localhost:9088/mydatabase:INFORMIXSERVER=ol_informix1170
db.driver=com.informix.jdbc.IfxDriver
db.user=informix
db.pass=password

但是在运行我的 Play 时出现异常!应用:

An unexpected error occured caused by exception PersistenceException: org.hibernate.TransactionException: JDBC begin failed:

play.exceptions.UnexpectedException: Unexpected Error
        at play.Invoker$Invocation.onException(Invoker.java:153)
        at play.Invoker$Invocation.run(Invoker.java:195)
        at Invocation.HTTP Request(Play!)
Caused by: javax.persistence.PersistenceException: org.hibernate.TransactionException: JDBC begin failed:
        at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1235)
        at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1168)
        at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:1245)
        at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:63)
        at play.db.jpa.JPAPlugin.startTx(JPAPlugin.java:321)
        at play.db.jpa.JPAPlugin.beforeInvocation(JPAPlugin.java:289)
        at play.Invoker$Invocation.before(Invoker.java:116)
        at play.Invoker$Invocation.run(Invoker.java:186)
        ... 1 more
Caused by: org.hibernate.TransactionException: JDBC begin failed:
        at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:96)
        at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1463)
        at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:60)
        ... 5 more
Caused by: java.sql.SQLException: Transactions not supported
        at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:413)
        at com.informix.jdbc.IfxSqliConnect.setAutoCommit(IfxSqliConnect.java:2189)
        at com.mchange.v2.c3p0.impl.NewProxyConnection.setAutoCommit(NewProxyConnection.java:881)
        at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:91)
        ... 7 more

我想是因为我试图在事务中执行我的查询,但我没有指定 XA 驱动程序。只有 com.informix.jdbc.IfxDriver。但是我似乎找不到用于 Informix 的 XA 驱动程序。

如何配置我的 Play!使用 Informix 的应用程序?

谢谢

【问题讨论】:

    标签: hibernate informix playframework


    【解决方案1】:

    问题在于您没有正确配置 Informix。您的数据库未配置事务日志记录,因此它不支持事务。不是真正的 Hibernate 也不是 Play!问题。因此,请使用以下内容重新创建您的表格:

    CREATE DATABASE mydatabase WITH LOG;
    

    http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.ddi.doc/ddi73.htm

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-02
      • 2010-12-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-26
      相关资源
      最近更新 更多