@ -9,9 +9,9 @@ This section addresses those questions.
@@ -9,9 +9,9 @@ This section addresses those questions.
[[howto.batch.specifying-a-data-source]]
== Specifying a Batch Data Source
By default, batch applications require a javadoc:javax.sql.DataSource[] to store job details.
Spring Batch expects a single javadoc:javax.sql.DataSource[] by default.
To have it use a javadoc:javax.sql.DataSource[] other than the application’s main javadoc:javax.sql.DataSource[], declare a javadoc:javax.sql.DataSource[] bean, annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.batch.jdbc.autoconfigure.BatchDataSource[format=annotation].
Batch applications that store job details in an SQL database require a javadoc:javax.sql.DataSource[] bean.
A single javadoc:javax.sql.DataSource[] bean is required by default.
To have Spring Batch use a javadoc:javax.sql.DataSource[] other than the application’s main javadoc:javax.sql.DataSource[], declare a javadoc:javax.sql.DataSource[] bean, annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.batch.jdbc.autoconfigure.BatchDataSource[format=annotation].
If you do so and want two data sources (for example by retaining the main auto-configured javadoc:javax.sql.DataSource[]), set the `defaultCandidate` attribute of the javadoc:org.springframework.context.annotation.Bean[format=annotation] annotation to `false`.
@ -66,10 +66,3 @@ This allows them to be modified or removed.
@@ -66,10 +66,3 @@ This allows them to be modified or removed.
NOTE: When you're using a custom javadoc:org.springframework.batch.core.JobParametersIncrementer[], you have to gather all parameters managed by the incrementer to restart a failed execution.
[[howto.batch.storing-job-repository]]
== Storing the Job Repository
Spring Batch requires a data store for the javadoc:org.springframework.batch.core.Job[] repository.
If you use Spring Boot, you must use an actual database.
Note that it can be an in-memory database, see {url-spring-batch-docs}/job.html#configuringJobRepository[Configuring a Job Repository].