Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Hibernate 3.0
Mapping documents:
<hibernate-configuration>
<session-factory
name="java:hibernate/SessionFactory">
<!-- <property name="hibernate.cglib.use_reflection_optimizer">false</property> -->
<property name="show_sql">true</property>
<property name="connection.datasource">jdbc/TRCSXADataSource</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="jndi.class">com.ibm.websphere.naming.WsnInitialContextFactory</property>
<property name="hibernate.session_factory_name">java:hibernate/SessionFactory</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="jndi.class">com.ibm.websphere.naming.WsnInitialContextFactory</property>
<mapping resource="acs/TMessageHeader.hbm.xml" />
</session-factory>
</hibernate-configuration>
Code between sessionFactory.openSession() and session.close():
session = (Session) HibernateUtil.currentSession();
con = session.connection();
prepStmtHdlr = con.prepareStatement(session. getNamedQuery("MESSAGE_HEADER_SIMP_INSERT_SQL").getQueryString());
messageID = ((Long)session.getNamedQuery("MESSAGE_ID_SEQ_NUM").uniqueResult()).longValue();
prepStmtHdlr.setLong(1, messageID);
prepStmtHdlr.setLong(2, txseq);
prepStmtHdlr.setLong(3, 501);
prepStmtHdlr.setLong(4, 1);
prepStmtHdlr.executeUpdate();
System.out.println("Update Count = " + prepStmtHdlr.getUpdateCount());
Full stack trace of any exception that occurs:
[10/31/06 15:30:49:094 EST] 0000004d SystemOut O DSRA9110E: Statement is closed.
Name and version of the database you are using:
Oracle 10 G
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
If I use hibernate transaction with oracle.jdbc.pool.OracleConnectionPoolDataSource works fine,
If I use XA data source it raise exception with statement closed, why does it should close the statement
I am missing some thing or need to configured differently
Read this:
http://hibernate.org/42.html