title: Issues with Spring Batch
body: <p>Hi I have been working in Spring batch recently and need some help.</p>
  
  <p>1) I want to run my Job using multiple threads, hence I have used TaskExecutor as below, </p>
  
  <pre><code>            @Bean
              public TaskExecutor taskExecutor() {
                  SimpleAsyncTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor();
                  taskExecutor.setConcurrencyLimit(4);
                  return taskExecutor;
              }
  
      @Bean
          public Step myStep() {
              return stepBuilderFactory.get("myStep")
                      .&lt;MyEntity,AnotherEntity&gt; chunk(1)
                      .reader(reader())
                      .processor(processor())
                      .writer(writer())
                      .taskExecutor(taskExecutor())
                      .throttleLimit(4)
                       .build();
          }
  </code></pre>
  
  <p>but, while executing in can see below line in console.</p>
  
  <blockquote>
    <p>o.s.b.c.l.support.SimpleJobLauncher      : No TaskExecutor has been set, defaulting to synchronous executor.</p>
  </blockquote>
  
  <p>What does this mean? However, while debugging I can see four SimpleAsyncExecutor threads running. Can someone shed some light on this?</p>
  
  <p>2) I don't want to run my Batch application with the metadata tables that spring batch creates. I have tried adding <code>spring.batch.initialize-schema=never</code>. But it didn't work. I also saw some way to do this by using <code>ResourcelessTransactionManager</code>, <code>MapJobRepositoryFactoryBean</code>. But I have to make some database transactions for my job. So will it be alright if I use this?
  Also I was able to do this by extending <code>DefaultBatchConfigurer</code> and overriding:</p>
  
  <pre><code>@Override
      public void setDataSource(DataSource dataSource) {
          // override to do not set datasource even if a datasource exist.
          // initialize will use a Map based JobRepository (instead of database)
      }
  </code></pre>
  
  <p>Please guide me further. Thanks.</p>
  
  <p>Update:</p>
  
  <p>My full configuration class here.</p>
  
  <pre><code>@EnableBatchProcessing
  @EnableScheduling
  @Configuration
  public class MyBatchConfiguration{
  
      @Autowired
      public JobBuilderFactory jobBuilderFactory;
  
      @Autowired
      public StepBuilderFactory stepBuilderFactory;
  
      @Autowired
      public DataSource dataSource;
  
  
      /* @Override
          public void setDataSource(DataSource dataSource) {
              // override to do not set datasource even if a datasource exist.
              // initialize will use a Map based JobRepository (instead of database)
          }*/
      @Bean
      public Step myStep() {
  
          return stepBuilderFactory.get("myStep")
                  .&lt;MyEntity,AnotherEntity&gt; chunk(1)
                  .reader(reader())
                  .processor(processor())
                  .writer(writer())
                  .taskExecutor(executor())
                  .throttleLimit(4)
                  .build();
      }
  
      @Bean
      public Job myJob() {
  
          return jobBuilderFactory.get("myJob")
                  .incrementer(new RunIdIncrementer())
                  .listener(listener())
                  .flow(myStep())
                  .end()
                  .build();
      }
  
      @Bean
      public MyJobListener myJobListener()
      {
          return new MyJobListener();
      }
      @Bean
      public ItemReader&lt;MyEntity&gt; reader()
      {
  
          return new MyReader();
      }
  
      @Bean
      public ItemWriter&lt;? super AnotherEntity&gt; writer()
      {
          return new MyWriter();
      }
  
      @Bean
      public ItemProcessor&lt;MyEntity,AnotherEntity&gt; processor()
      {
          return new MyProcessor();
      }
  
      @Bean
      public TaskExecutor taskExecutor() {
          SimpleAsyncTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor();
          taskExecutor.setConcurrencyLimit(4);
          return taskExecutor;
      }}
  </code></pre>