-->
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.  [ 6 posts ] 
Author Message
 Post subject: DB exception while calling sess.flush()
PostPosted: Fri Jun 25, 2004 12:07 pm 
Newbie

Joined: Thu Jun 24, 2004 6:09 pm
Posts: 9
I have following code which uses Hibernate to persist the order data.

//######
sess.save(order);
sess.flush();
//######

When I run the routine to save order for the first time, it just saves fine. But if I try to save one mor eorder in the same session I am getting following exceptions.

Can some one throw me pointer on this?
Thanks


[6/25/04 11:59:48:843 EDT] 3f8ee029 SystemErr R java.lang.NullPointerException
[6/25/04 11:59:48:843 EDT] 3f8ee029 SystemErr R at oracle.jdbc.dbaccess.DBData.clearItem(DBData.java:431)
[6/25/04 11:59:48:843 EDT] 3f8ee029 SystemErr R at oracle.jdbc.dbaccess.DBDataSetImpl.clearItem(DBDataSetImpl.java:3528)
[6/25/04 11:59:48:843 EDT] 3f8ee029 SystemErr R at oracle.jdbc.driver.OraclePreparedStatement.clearParameters(OraclePreparedStatement.java:3401)
[6/25/04 11:59:48:858 EDT] 3f8ee029 SystemErr R at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.resetStatement(WSJdbcConnection.java:1719)
[6/25/04 11:59:48:858 EDT] 3f8ee029 SystemErr R at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:1415)
[6/25/04 11:59:48:858 EDT] 3f8ee029 SystemErr R at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:1381)
[6/25/04 11:59:48:858 EDT] 3f8ee029 SystemErr R at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:249)
[6/25/04 11:59:48:858 EDT] 3f8ee029 SystemErr R at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:61)
[6/25/04 11:59:48:858 EDT] 3f8ee029 SystemErr R at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:56)
[6/25/04 11:59:48:858 EDT] 3f8ee029 SystemErr R at net.sf.hibernate.impl.BatcherImpl.prepareBatchStatement(BatcherImpl.java:109)
[6/25/04 11:59:48:858 EDT] 3f8ee029 SystemErr R at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:460)
[6/25/04 11:59:48:858 EDT] 3f8ee029 SystemErr R at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
[6/25/04 11:59:48:858 EDT] 3f8ee029 SystemErr R at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
[6/25/04 11:59:48:858 EDT] 3f8ee029 SystemErr R at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414)
[6/25/04 11:59:48:858 EDT] 3f8ee029 SystemErr R at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2367)
[6/25/04 11:59:48:858 EDT] 3f8ee029 SystemErr R at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 25, 2004 5:10 pm 
Regular
Regular

Joined: Tue Sep 16, 2003 11:35 am
Posts: 93
Location: San Francisco, CA
doesn't look familiar to me, perhaps you should post all your mapping and java code


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 28, 2004 1:32 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Use the latest Oracle driver

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 28, 2004 4:39 pm 
Newbie

Joined: Thu Jun 24, 2004 6:09 pm
Posts: 9
I am using the OracleXADataSource in this case.

Also I have configured DB2 UDB for iSeries (Toolbox XA) data source to persist the data in DB2.

My program flow is like this..

1. In a stateless session bean I have insert() routine.
2. Which internally calls insert() of my Database helper class.
3. Insert() looks like as follows:

publc void insert(Order order)
{
insertToDB2(order);
insertToOracle(order);
}

So global transaction takes care of inserting into the respective places.

When I run this in a session,
1. I invoke insert() routine. It populates order record both in DB2 and Oracle. So far NO ERRORS.
2. I invoke insert() again in the same session. insertToDB2() is PERFECT. But throws the above exception when calling insertToOracle().


So first time in a session works GREAT. Second time onwards IT FAILS.

Can some one help me in this?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 29, 2004 5:03 pm 
Newbie

Joined: Thu Jun 24, 2004 6:09 pm
Posts: 9
My Hibernate configuration is as follows for the above case. Can some one point out any mistakes?
-----------------------------------------------------------------------------------
<hibernate-configuration>
<session-factory>
<!-- Data Source -->
<property name="connection.datasource">java:comp/env/jdbc/OracleXADataSource</property>

<!-- Database Settings -->
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
<property name="show_sql">true</property>

<!-- JDBC Settings -->
<property name="jdbc.use_streams_for_binary">true</property>
<property name="max_fetch_depth">1</property>

<!-- Cache settings -->
<property name="cache.provider_class">net.sf.hibernate.cache.HashtableCacheProvider</property>
<!-- Transaction API -->
<property name="transaction.manager_lookup_class">
net.sf.hibernate.transaction.WebSphereTransactionManagerLookup</property>

<!-- Mapping files -->
<mapping resource="com/domain/Order.hbm.xml"/>
<mapping resource="com/domain/OrderLineItem.hbm.xml"/>
</session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 06, 2004 11:07 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I still recommand to use the latest oracle version because the NPE is inside oracle driver...
I experienced some issues with Oracle XA driver but not the one you point

_________________
Emmanuel


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

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.