Skip to content

Commit 1761ff0

Browse files
committed
Clarify Batch docs on the need for a DataSource and DB-based repository
Closes gh-48233
1 parent 4d3e374 commit 1761ff0

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

documentation/spring-boot-docs/src/docs/antora/modules/ROOT/pages/redirect.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@
393393
* xref:how-to:batch.adoc#howto.batch.specifying-a-data-source[#howto-spring-batch-specifying-a-data-source]
394394
* xref:how-to:batch.adoc#howto.batch.specifying-a-data-source[#howto.batch.specifying-a-data-source]
395395
* xref:how-to:batch.adoc#howto.batch.specifying-a-transaction-manager[#howto.batch.specifying-a-transaction-manager]
396-
* xref:how-to:batch.adoc#howto.batch.storing-job-repository[#howto-spring-batch-storing-job-repository]
397-
* xref:how-to:batch.adoc#howto.batch.storing-job-repository[#howto.batch.storing-job-repository]
396+
* xref:reference:io/spring-batch.adoc#io.spring-batch[#howto-spring-batch-storing-job-repository]
397+
* xref:reference:io/spring-batch.adoc#io.spring-batch[#howto.batch.storing-job-repository]
398398
* xref:how-to:batch.adoc#howto.batch[#howto-batch-applications]
399399
* xref:how-to:batch.adoc#howto.batch[#howto.batch]
400400
* xref:how-to:build.adoc#howto.build.build-an-executable-archive-with-ant-without-using-spring-boot-antlib[#howto-build-an-executable-archive-with-ant]

documentation/spring-boot-docs/src/docs/antora/modules/how-to/pages/batch.adoc

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ This section addresses those questions.
99
[[howto.batch.specifying-a-data-source]]
1010
== Specifying a Batch Data Source
1111

12-
By default, batch applications require a javadoc:javax.sql.DataSource[] to store job details.
13-
Spring Batch expects a single javadoc:javax.sql.DataSource[] by default.
14-
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].
12+
Batch applications that store job details in an SQL database require a javadoc:javax.sql.DataSource[] bean.
13+
A single javadoc:javax.sql.DataSource[] bean is required by default.
14+
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].
1515
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`.
1616

1717

@@ -66,10 +66,3 @@ This allows them to be modified or removed.
6666
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.
6767

6868

69-
70-
[[howto.batch.storing-job-repository]]
71-
== Storing the Job Repository
72-
73-
Spring Batch requires a data store for the javadoc:org.springframework.batch.core.Job[] repository.
74-
If you use Spring Boot, you must use an actual database.
75-
Note that it can be an in-memory database, see {url-spring-batch-docs}/job.html#configuringJobRepository[Configuring a Job Repository].

0 commit comments

Comments
 (0)