title: Spring Batch - Can two different batches share the same Meta-Data datasource?
body: <p>I have two different Spring Batch projects, both are configured to have the same datasource (same DB schema) for the Meta-Data tables:</p>
  
  <ol>
  <li><p><em>application.properties</em> (Spring Batch A)</p>
  
  <pre><code>spring.datasource.jdbc-url=jdbc:mysql://localhost:3306/my_batch
  </code></pre></li>
  <li><p><em>application.properties</em> (Spring Batch B)</p>
  
  <pre><code>spring.datasource.jdbc-url=jdbc:mysql://localhost:3306/my_batch
  </code></pre></li>
  </ol>
  
  <p><br>
  After successfully running Spring Batch A for several times, I ran Spring Batch B and it threw a <code>JobExecutionAlreadyRunningException</code>. </p>
  
  <p>Example:</p>
  
  <blockquote>
    <p>org.springframework.batch.core.repository.JobExecutionAlreadyRunningException: A job execution for this job is already running: JobInstance: id=2, JobParameters=[{}], Job=[MyBatchName]</p>
  </blockquote>
  
  <p><br>
  During that time, Spring Batch A is no longer running. The exception seems to indicate that the Job Instance ID is already taken by Spring Batch A and cannot be used by Spring Batch B.</p>
  
  <p>Question:</p>
  
  <blockquote>
    <p>Can a Spring Batch Meta-Data Schema support multiple Spring Batch projects?</p>
  </blockquote>