Process Does Not Terminate When Processing Multiple Items #4515
Labels
status: waiting-for-reporter
Issues for which we are waiting for feedback from the reporter
type: bug
Bug description
I recently upgraded my project's SpringBoot version to 3, along with an upgrade to Spring Batch version 5.
However, I've encountered an issue while executing Batch processes. During the execution of ItemWriter logic, the process unexpectedly halts. Although I've enabled the show-sql option and observed that some queries are being generated, the intended queries do not fully execute and the process remains running.
The point at which it halts varies randomly with each execution, and very occasionally, all intended queries are executed, allowing the process to commit and terminate normally.
TL;DR:
Upgraded to SpringBoot 3.
When ItemReader processes a single item, the commit always executes, and the process terminates normally.
When processing more than one item, the process randomly stops at certain points, and neither commit nor process termination occurs.
Environment
Spring Batch 5.0.3 / Spring Boot 3.1.5 / Java 17 / JPA Hibernate 6
Steps to reproduce
Below is the code I modified while upgrading to version 5 of Spring Batch
Below is an example of one of the jobs where the issue is occurring.
I'm wondering if the TxManager is incorrectly configured. In the job, I'm injecting the jpaTransactionManager bean, which is the TxManager being used effectively throughout the application.
In the BatchConfig, I've created and registered a JdbcTransactionManager as a bean.
Expected behavior
I expect the process to commit successfully and terminate normally when processing multiple items
same question in stackOverFlow
The text was updated successfully, but these errors were encountered: