-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate in CMP transaction
PostPosted: Tue Oct 31, 2006 4:39 pm 
Newbie

Joined: Tue Oct 31, 2006 4:13 pm
Posts: 1
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


_________________
Thx
Ashok Segu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.