-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JdbcItemReader restart behavior #103
Comments
I think the reason is, in the we can For instance, if we read the first item, process it, but failed in writer, hence rollback. The reader checkpoint info is now 1. When restarting, we set reposition the resultSet to Have you seen any actual unexpected behavior in restarting in your app? Any reproducible app will be even better for pinpointing the problem. |
I think the point is, that it's not the current row that gets persisted as a checkpoint in your example, because the transaction gets rolled back. So the checkpoint will be the index of the last item that was successfully processed and committed depending on your chunk size. I experienced unexpected behavior in the following szenario: Suppose you process 20 elements with a chunk size of 10. So for every 10 elements, the current row is used as a checkpoint and the entire chunk is passed to the writer. If processing of element 11 leads to an error, the last checkpoint is position 10. On retry, my app ends up processing element 10 twice, because The |
https://issues.jboss.org/browse/JBERET-364 was created to track this issue and fix. |
This issue should be fixed with the above commit. Thanks for reporting it. Let's know if anything else. |
Hi,
I think JdbcItemReader might have an issue with its checkpoint information. The method
checkpointInformation()
always returnscurrentRowNumber
. So, in case of a transaction rollback, this would be the last record in the result set, that got successfully processed and committed. Therefore I'd expectopen()
to set the result set cursor to this exact position and continue processing (rs.next()
) after the last successfully processed item.Is there any other reason for
open()
to usecheckpoint - 1
instead of justcheckpoint
?Best,
-fd
The text was updated successfully, but these errors were encountered: