-->
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: Batch Insert
PostPosted: Fri Jul 08, 2005 5:45 pm 
Newbie

Joined: Fri Jul 08, 2005 5:19 pm
Posts: 2
I am trying to use batch insert using hibernate. I am using Oracle .
Have set up in hibernate.cfg.xml
hibernate.jdbc.batch_size=20
hibernate.jdbc.fetch_size=20

I am using oracle sequence for insert and so have the sequence
also set in file hbm.xml
<param name="sequence">XYZ_ID_SEQ</param>


However , it seems like although say 20 inserts it does in one batch with one round trip to the database. But to get the oracle generated sequence value it has to do 20 roundtrips to the database for each insert.

So actually it takes 21 round trips to insert 20 rows in the database.

Is there a solution to reduce it to only 2 or 3 round trips.

Thanks,
vikas


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.