Hello,
Could you help me with this problem. I have an exception thrown when calling session.beginTransaction() with an Informix database.
But the same application is working fine with a MySQL Database !
The error tell me that transaction are not supported with this base (witch is not true, because we are already using this base in an swing transactionnal application).
I know it is probably not an Hibernate problem, but if you have any ideas !
I am quite knew with Hibernate. You will find here the hibernate config and also the stack trace.
(please note also that the same request, without transaction, is working fine)
Hibernate version: 3.0
Mapping documents:
<hibernate-configuration>
<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory name="java:hibernate/SessionFactory">
<!-- properties -->
<property name="connection.datasource">netqi_db</property>
<property name="hibernate.dialect">org.hibernate.dialect.InformixDialect</property>
<property name="hibernate.hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="show_sql">true</property>
<!-- mapping files -->
<mapping resource="WEB-INF/classes/hibernate/Origin.hbm.xml" />
//...
</session-factory>
</hibernate-configuration>
<hibernate-mapping package="com.netqi.business.beans.misc">
<class name="Origin" table="origine_contact" lazy="false">
<id name="id" column="id_origine" type="string" unsaved-value="0" >
<generator class="identity" />
</id>
<property name="name" column="description" type="string" not-null="true"/>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:
java.sql.SQLException: Transactions not supported
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:355)
at com.informix.jdbc.IfxSqliConnect.setAutoCommit(IfxSqliConnect.java:1714)
at org.objectweb.jonas.jdbc_xa.ConnectionImpl.setAutoCommit(ConnectionImpl.java:316)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:53)
at org.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:19)
at org.hibernate.jdbc.JDBCContext.beginTransaction(JDBCContext.java:204)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1007)
15:16:25 ERROR [com.netqi.portals.business.BusinessContext] --> PersistenceSessionException
com.netqi.portals.exceptions.PersistenceSessionException: org.hibernate.TransactionException: JDBC begin failed:
at com.netqi.portals.persistence.hibernate.HibernateSession.beginTransaction(HibernateSession.java:35)
at com.netqi.portals.business.BusinessContext.runInTransaction(BusinessContext.java:68)
at com.netqi.portals.business.GenericBusinessService.delete(GenericBusinessService.java:102)
at com.netqi.softwareportal.actions.DeleteAction.deleteOrigin(DeleteAction.java:73)
at com.netqi.softwareportal.actions.DeleteAction.execute(DeleteAction.java:45)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
Caused by: org.hibernate.TransactionException: JDBC begin failed:
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:58)
at org.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:19)
at org.hibernate.jdbc.JDBCContext.beginTransaction(JDBCContext.java:204)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1007)
at com.netqi.portals.persistence.hibernate.HibernateSession.beginTransaction(HibernateSession.java:33)
... 47 more
Caused by: java.sql.SQLException: Transactions not supported
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:355)
at com.informix.jdbc.IfxSqliConnect.setAutoCommit(IfxSqliConnect.java:1714)
at org.objectweb.jonas.jdbc_xa.ConnectionImpl.setAutoCommit(ConnectionImpl.java:316)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:53)
... 51 more
Name and version of the database you are using:
Informix onLine 7.3
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|