title: Spring Batch - How to prevent batch from storing transactions in DB
body: <p>First the problem statement:
  I am using Spring-Batch in my DEV environment fine. When I move the code to a production environment I am running into a problem. In my DEV environment, Spring-Batch is able to create it's transaction data tables in our DB2 database server with out problem. This is not a option when we go to PROD as this is a read only job. </p>
  
  <p>Attempted solution: </p>
  
  <p>Search Stack Overflow I found this posting: 
  <a href="https://stackoverflow.com/questions/25077549/spring-batch-without-persisting-metadata-to-database">Spring-Batch without persisting metadata to database?</a></p>
  
  <p>Which sounded perfect, so I added</p>
  
  <pre><code>@Bean
  public ResourcelessTransactionManager transactionManager() {
      return new ResourcelessTransactionManager();
  }
  
  @Bean
  public JobRepository jobRepository(ResourcelessTransactionManager transactionManager) throws Exception {
      MapJobRepositoryFactoryBean mapJobRepositoryFactoryBean = new MapJobRepositoryFactoryBean(transactionManager);
      mapJobRepositoryFactoryBean.setTransactionManager(transactionManager);
  
      return mapJobRepositoryFactoryBean.getObject();
  }
  </code></pre>
  
  <p>I also added it to my Job by calling .reporitory(jobRepository).</p>
  
  <p>But I get </p>
  
  <pre><code>Caused by: java.lang.NullPointerException: null
      at       org.springframework.batch.core.repository.dao.MapJobExecutionDao.synchronizeStatus(MapJobExecutionDao.java:158) ~[spring-batch-core-3.0.6.RELEASE.jar:3.0.6.RELEASE]
  </code></pre>
  
  <p>So I am not sure what to do here. I am new to Spring so I am teaching myself as I go. I am open to other solutions, such as an in memory database, but I have not been able to get them to work either. I do NOT need to save any state or session information between runs, but the data base query I am running will return around a million or so rows, so I will need to get that in chunks. </p>
  
  <p>Any suggestions or help would be greatly appreciated. </p>