title: rollback mechanism for chunk oriented processing strategy of Spring Batch
body: <p>As we  all know, spring batch uses chunk oriented processing since the version 2.0.</p>
  
  <p>Does it mean that, if an exception occurs in the item writer, the Data Source Transaction manager will roll back the whole chunk or only the related item? </p>
  
  <p>Actually, I gave it a try and saw that the framework rolls back the whole chunk. That's not what I need because I do not want, let's say, 499 items which have been processed successfully to be rolled back in a chunk consisting of 500 items when the last item causes an exception to be thrown.</p>
  
  <p>The only solution I was able to find is to add the attribute below to my tasklet. However, I am not sure if this is the right thing to do.</p>
  
  <pre><code>&lt;batch:transaction-attributes propagation="NOT_SUPPORTED"/&gt; 
  </code></pre>
  
  <p>Another opinion was to simply reduce the chunk size to 1 (one) but that one also doesn't make much sense.</p>
  
  <p>Maybe Spring Batch is not suitable for my problem domain. If so, please tell me so I won't be struggling with those kind of framework specific behaviour anymore.</p>
  
  <p>Any suggestions would be greatly appreciated.</p>