title: Spring Batch - how to fail a job when the ItemReader returns no data
body: <p>I have a spring batch application which reads data from a DB table with JdbcCursorItemReader and writes it to a flat file with FlatFileItemWriter. </p>
  
  <p>When I test my application, I see that the FlatFileItemWriter creates a file even if no data is returned from the DB via JdbcCursorItemReader. However, I'm planning to fail my job when there is no appropriate data in DB. Is it possible to do so or at least prevenet FlatFileItemWriter from creating a file?</p>
  
  <p>Regards</p>