-->
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.  [ 2 posts ] 
Author Message
 Post subject: hibernate batch insert and update
PostPosted: Sun Jun 07, 2009 3:32 pm 
Newbie

Joined: Sun Jun 07, 2009 3:28 pm
Posts: 1
Hi,
I have to insert 6000 rows into database.
does batch insert update improve response time?
how should i decide batch size?
Is there other alternative to improve response time?


Top
 Profile  
 
 Post subject: Re: hibernate batch insert and update
PostPosted: Mon Jun 08, 2009 2:57 am 
Beginner
Beginner

Joined: Mon Jun 01, 2009 5:39 am
Posts: 34
Batch insert will always improve response time.

See the reference guide (you can download the PDF from the documentation section of the site). Basically, you session.save() in a loop, and after a certain number of save(), you session.flush(), until all your objects are done. Then .commit() the transaction.


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