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
|