-->
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: Hibernate save is slow
PostPosted: Thu Dec 09, 2010 11:40 am 
Newbie

Joined: Wed Dec 08, 2010 5:26 am
Posts: 4
Hi All,
I have a requirement, where i need to save 5000 records at a time. currently for saving 1000 records it is saving more than 1 minute. in such a case for saving 5000 records it may take around 5 minutes. i am adding the code what i have written. please suggest how can i reduce save time. i am using merge() for saving..if i dont use merge, if i use saveOrUpdate() or save() i am getting nonuniqueobject exception. please suggest me....

for (LoadGsCmpTape loadGsCmpTape : cmpTapeList) {
if(loadGsCmpTape.getCmpSetId()== null || loadGsCmpTape.getCmpSetId()== 0L){
loadGsCmpTape.setCmpSetId(currentSetId);
}
this.getHibernateTemplate().merge(loadGsCmpTape);

}


Thanks,
Salmon


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.