I have two different Spring Batch projects, both are configured to have the same datasource (same DB schema) for the Meta-Data tables:
application.properties (Spring Batch A)
spring.datasource.jdbc-url=jdbc:mysql://localhost:3306/my_batch
application.properties (Spring Batch B)
spring.datasource.jdbc-url=jdbc:mysql://localhost:3306/my_batch
After successfully running Spring Batch A for several times, I ran Spring Batch B and it threw a JobExecutionAlreadyRunningException
.
Example:
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException: A job execution for this job is already running: JobInstance: id=2, JobParameters=[{}], Job=[MyBatchName]
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.
Question:
Can a Spring Batch Meta-Data Schema support multiple Spring Batch projects?