Informix XA 驱动程序正在运行!框架应用
我正在尝试使用 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?
谢谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是您没有正确配置 Informix。您的数据库未配置事务日志记录,因此它不支持事务。不是真正的 Hibernate 也不是 Play!问题。因此,请使用以下内容重新创建表:
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:
http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.ddi.doc/ddi73.htm