Results 1 to 2 of 2

Thread: commit interval and Hibernate batch size

  1. #1

    Default 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. #2
    Join Date
    Dec 2006
    Posts
    1,061

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •