title: How to bulk insert using Spring-Batch?
body: <p>I'm using spring-batch and spring-data-jpa to read large csv data files and persist (or update existing) entries to a postgresql db using hibernate.</p>
  
  <p>How do I have to configure spring to make using of batch/bulk inserts?</p>
  
  <p>When I configure the job <code>step</code>, I set the <code>chunk</code> size accordingly:</p>
  
  <pre><code>StepBuilderFactory step;
  step.chunk(10000).reader(csvReader).writer(jpaItemWriter).build();
  </code></pre>
  
  <p>Do I further have to be concerned about the <code>hibernate.jdbc.batch_size</code> property? Do I have to also set it, maybe to the same size as the chunk size?</p>