Announcement Announcement Module
Collapse
No announcement yet.
commit interval and Hibernate batch size Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • commit interval and Hibernate batch size

    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?

  • #2
    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();
    		}
    	}

    Comment

    Working...
    X