-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to Retrieve a batch insert result
PostPosted: Wed Aug 10, 2005 3:08 am 
Newbie

Joined: Thu Feb 03, 2005 5:49 am
Posts: 19
Hello.

I'm performing a lot of insert and as the reference documentation explain for this case I have set the jdbc.batch_size to X and I flush and clear the session each X insert.

The problem is, when I flush the session how could I get the batch result?

(the array of int that you get when you use the executeBatch method of a JDBC Statement)

I would need this array in order to know if one of the insert was wrong.

Thanks in advanced.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 10, 2005 3:27 am 
Newbie

Joined: Thu Feb 03, 2005 5:49 am
Posts: 19
Ok, I've been reading about executeBatch method in JDBC.

It seems there are two possibilities depending of the jdbc driver

1 - JDBC driver throws a BatchUpdateException when a command was wrong.

2 - JDBC driver performs the whole batch and returns the int array.

I'm using the Oracle thin client for JDBC and I think this driver throws a BatchUpdateException when one command can't be executed so in this case I would get and JDBCException from hibernate and using the getSQLException I suppose I would get the BatchUpdateException.

Is this correct?

Thanks in advanced.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 10, 2005 3:29 am 
Expert
Expert

Joined: Thu May 26, 2005 9:19 am
Posts: 262
Location: Oak Creek, WI
Hi

I do have the same problem. Any help!!!!

_________________
RamnathN
Senior Software Engineer
http://www.linkedin.com/in/ramnathn
Don't forget to rate.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.