Just learning Spring Batch but I had the same problem. Our transactional requirements are to process the entire file or nothing at all, so I needed a commit-interval of #lines. I used the completion policy idea but found that I could use the provided org.springframework.batch.repeat.policy.DefaultRes ultCompletionPolicy in the chunk attribute chunk-completion-policy. Saved me from writing something custom. I haven't tested exhaustively but seems to be doing what I want.
Code:
<batch:job id="myJob"><batch:step id="processAFile"><batch:tasklet>
<batch:chunk reader="myReader" writer="myFileWriter"
chunk-completion-policy="wholeFileCompletionPolicy"/>
</batch:tasklet>
</batch:step>
</batch:job>
<bean id="wholeFileCompletionPolicy" class="org.springframework.batch.repeat.policy.DefaultResultCompletionPolicy"/>