Skip to content

Commit 4e5b7d2

Browse files
committed
Elaborate usage of transaction manager in documentation
Resolves #4787
1 parent 8020331 commit 4e5b7d2

File tree

1 file changed

+8
-2
lines changed
  • spring-batch-docs/modules/ROOT/pages/step/chunk-oriented-processing

1 file changed

+8
-2
lines changed

spring-batch-docs/modules/ROOT/pages/step/chunk-oriented-processing/configuring.adoc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ item-based step and the number of items to be processed before the transaction i
4848
committed.
4949
+
5050
NOTE: Note that `repository` defaults to `jobRepository` (provided through `@EnableBatchProcessing`)
51-
and `transactionManager` defaults to `transactionManager` (provided from the application context).
51+
and `transactionManager` defaults to `transactionManager` (provided from the application context). The
52+
transaction manager is optional and defaults to a `ResourcelessTransactionManager`.
5253
Also, the `ItemProcessor` is optional, since the item could be
5354
directly passed from the reader to the writer.
5455
@@ -85,10 +86,15 @@ optional, since the item could be directly passed from the reader to the writer.
8586

8687

8788

88-
The preceding configuration includes the only required dependencies to create a item-oriented
89+
The preceding configuration includes the only required dependencies to create an item-oriented
8990
step:
9091

9192
* `reader`: The `ItemReader` that provides items for processing.
9293
* `writer`: The `ItemWriter` that processes the items provided by the `ItemReader`.
9394

95+
NOTE: The transaction manager used in the step could be different from the one used in the job
96+
repository. The caveat though is that the job repository and the processing database
97+
won't be in the same transaction, so if a failure occurs after processing but before the job
98+
repository is updated, the step could be re-executed and lead to duplicate processing. This could
99+
be mitigated through idempotent processing or external transaction management (e.g., JTA).
94100

0 commit comments

Comments
 (0)