title: Spring Batch : How to change the default isolation level?
body: <p>I read in the documentation :</p>
  <blockquote>
  <p>&quot;The default is ISOLATION_SERIALIZABLE, which prevents accidental
  concurrent execution of the SAME job&quot;</p>
  </blockquote>
  <p>However, when I launch DIFFERENT jobs at the the same time (with a default isolation level at SERIALIZABLE), I have the error : <code>ORA-08177: can't serialize access for this transaction.</code> Is it normal ?</p>
  <p>Second, to change the Default Isolation Level to READ_COMMITTED, I understood that we can't change this level in application.properties, and, that I have to redefine BatchConfigurer. Exact ?</p>
  <p>Using BasicBatchConfigurer, I must define an explicit contructor (implicit super constructor BasicBatchConfigurer() is undefined for default constructor).
  However, I have the error :</p>
  <pre><code> Parameter 0 of constructor in MyBatchConfigurer required a bean of type 'org.springframework.boot.autoconfigure.batch.BatchProperties' that could not be found.
  </code></pre>
  <p>How to create : BatchProperties properties, DataSource dataSource and TransactionManagerCustomizers transactionManagerCustomizers ?</p>
  <p>This is my code :</p>
  <p><strong>PeopleApplication.java</strong></p>
  <pre><code>@SpringBootApplication
  @EnableAutoConfiguration(exclude = { BatchAutoConfiguration.class })
  public class PeopleApplication {
      
      
      public static void main(String[] args) throws Exception {
          
          ConfigurableApplicationContext ctx =  new SpringApplicationBuilder(PeopleApplication.class)
          .web(WebApplicationType.NONE) 
          .run(args);
          
          int exitValue = SpringApplication.exit(ctx);
          System.exit(exitValue);
      }
  }
  </code></pre>
  <p><strong>MyBatchConfigurer.java</strong></p>
  <pre><code>@Component
  @PropertySource(&quot;classpath:fileA.properties&quot;)
  public class MyBatchConfigurer extends BasicBatchConfigurer implements CommandLineRunner, ExitCodeGenerator {
  
      protected MyBatchConfigurer(BatchProperties properties, DataSource dataSource, TransactionManagerCustomizers transactionManagerCustomizers) {
           super(properties, dataSource, transactionManagerCustomizers);
       }
       
       @Override
       protected String determineIsolationLevel() {
              return &quot;ISOLATION_&quot; + Isolation.READ_COMMITTED;
       }
  
      @Override
      public void run(String... args) {
          ...
      }
  
      ...
  }
  </code></pre>
  <p>Regards.</p>
  <hr />
  <p><strong>RESPONSE :</strong></p>
  <hr />
  <p>use <code>@EnableAutoConfiguration</code> instead of :</p>
  <pre><code>@EnableAutoConfiguration(exclude = { BatchAutoConfiguration.class })
  </code></pre>
  <p>Like this, the bean BatchProperties, DataSource and TransactionManagerCustomizers will be automatically created.</p>