Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NullPointerException from oracle when flushing the session

 
Ramona Gabriela
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, everyone

I am developing an application under IBM Portal and I am using Hibernate, among other things.
The problem is this : since I have to insert a large number of records into the database, i try to flush&clear the session after each ...let's say 20 items.
The code, simplified, is as follows:

Session session = sessionFactory.openSession();
Transaction tx = session.beginTransaction();
for (int i=0;i<clients.size();i++){
client = (ClientBean) clients.get(i);
session.save(client);

if ( i % 20 == 0 ) {
session.flush();
session.clear();
}
}
tx.commit();
session.close();

Problem is: when i run the application, i get a NullPointerException, like the one that follows:

[8/23/07 16:03:23:000 EEST] 6006770d SystemErr R java.lang.NullPointerException
[8/23/07 16:03:23:000 EEST] 6006770d SystemErr R at oracle.jdbc.dbaccess.DBData.clearItem(DBData.java:407)
[8/23/07 16:03:23:000 EEST] 6006770d SystemErr R at oracle.jdbc.dbaccess.DBDataSetImpl.clearItem(DBDataSetImpl.java:3528)


If anyone has any idea why is this happening, please help me with this issue.

Thank you, in advance
 
Shailesh Kini
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ramona,

Maybe you can turn tracing on oracle JDBC driver to get more information.

Oracle tracing
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic