Informix XA 驱动程序正在运行!框架应用

发布于 2024-10-10 09:34:01 字数 2388 浏览 4 评论 0 原文

我正在尝试使用 Informix 数据库来玩!框架应用。我是 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 时出现异常! app:

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?

谢谢

I am trying to use Informix database with a Play! Framework application. I am new to Informix.

I have Informix 11.70 installed on my windows machine and I am running Play 1.1.

In Play! you can specify your db connections like this:

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

I get an exception however in running my Play! app:

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

I think because I am trying to execute my query within a transaction but I haven't specified an XA driver. Only com.informix.jdbc.IfxDriver. However I can't seem to find the XA driver to use for Informix.

How can I configure my Play! application to use Informix?

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鼻尖触碰 2024-10-17 09:34:01

问题是您没有正确配置 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

The problem is that you didn't properly configured Informix. Your database is not configured for transaction logging, and so, it doesn't supports transactions. Not really a Hibernate nor Play! problem. So, recreate your table with something like:

CREATE DATABASE mydatabase WITH LOG;

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文