-->
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.  [ 4 posts ] 
Author Message
 Post subject: Batch Insert efficient way
PostPosted: Tue Nov 27, 2007 7:48 pm 
Newbie

Joined: Tue Nov 27, 2007 7:11 pm
Posts: 9
I have to insert some 6,000 rows into oracle database using Hibernate. Rather than looping thru the entire list of objects and using session.save(obj), Is there an efficient way of doing this.

Can i save the entire collection at a single shot.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 28, 2007 11:16 am 
Senior
Senior

Joined: Fri Jun 01, 2007 12:41 pm
Posts: 121
You can try Batch Processing and Batch Inserts. Refer to the URL
http://www.hibernate.org/hib_docs/refer ... batch.html


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 28, 2007 11:21 am 
Newbie

Joined: Tue Nov 27, 2007 7:11 pm
Posts: 9
Thanks for the reply, but i need to loop thru each and every object and save one by one right... I am looking for more efficient solution, ie., to save the entire collection at one shot with out looping.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 28, 2007 11:38 am 
Senior
Senior

Joined: Fri Jun 01, 2007 12:41 pm
Posts: 121
SharmilaGupta wrote:
Thanks for the reply, but i need to loop thru each and every object and save one by one right... I am looking for more efficient solution, ie., to save the entire collection at one shot with out looping.


Even I was looking for that solution. But didn't find one. I had to loop through the collection to save the individual objects. Thanks!!!


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