Closed manoop closed 1 year ago
I think this issue should be opened here: https://github.com/spring-projects/spring-batch
@manoop This issue is not related to any extension in this repository. Please open a discussion here: https://github.com/spring-projects/spring-batch/discussions. If the bug is valid, we will transform the discussion to an issue on the issue tracker. Thank you.
Using the spring batch version 4.3.7 I have created a simple application which has USER entity. The RepositoryItemReader builds the reader using the JPA repository, and the step configuration is done with Chunk size 10, input and output as the same entity object (User).
In the Processor each item (User) is set with the status='PROCESSED'.
Writer writes the entity finally to the database. There are total of 99 records. When the batch starts it fails to complete with the error.
Workaround: To fix this issue I tried with the stepBuilder chunk with 2 different input and output, it works fine with no stuck situation.
I have the complete code in the GitHub for review.
https://github.com/manoop/batch/tree/bugfix/thread-transaction
BATCH CONFIG
Processor
Writer