In order to improve the performance how do we need to configure the commit interval and hibernate batch size? do both them need to be equal?
In order to improve the performance how do we need to configure the commit interval and hibernate batch size? do both them need to be equal?
You can change the commit interval of spring batch easily with configuration. This commit interval should match your hibernate batch size if you're using the HibernateItemWriter, which essentially flushes at the end of the list:
Code:public final void write(List<? extends T> items) throws Exception { doWrite(hibernateTemplate, items); try { hibernateTemplate.flush(); } finally { // This should happen when the transaction commits anyway, but to be // sure... hibernateTemplate.clear(); } }