Skip to content

Commit f225df8

Browse files
Jay Bryantfmbenhassine
Jay Bryant
authored andcommitted
Fix for issue #3848
Added the content that didn't get carried forward from 4.2.x.
1 parent f51ed50 commit f225df8

File tree

1 file changed

+21
-0
lines changed
  • spring-batch-docs/src/main/asciidoc

1 file changed

+21
-0
lines changed

spring-batch-docs/src/main/asciidoc/job.adoc

+21
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,27 @@ created in addition to a number of beans made available to be autowired:
438438
The core interface for this configuration is the `BatchConfigurer`. The default
439439
implementation provides the beans mentioned above and requires a `DataSource` as a bean
440440
within the context to be provided. This data source is used by the JobRepository.
441+
You can customize any of these beans
442+
by creating a custom implementation of the `BatchConfigurer` interface.
443+
Typically, extending the `DefaultBatchConfigurer` (which is provided if a
444+
`BatchConfigurer` is not found) and overriding the required getter is sufficient.
445+
However, implementing your own from scratch may be required. The following
446+
example shows how to provide a custom transaction manager:
447+
448+
====
449+
[source, java]
450+
----
451+
@Bean
452+
public BatchConfigurer batchConfigurer() {
453+
return new DefaultBatchConfigurer() {
454+
@Override
455+
public PlatformTransactionManager getTransactionManager() {
456+
return new MyTransactionManager();
457+
}
458+
};
459+
}
460+
----
461+
====
441462

442463
[NOTE]
443464
====

0 commit comments

Comments
 (0)