Skip to content

Default value for ignoreWarnings in JdbcCursorItemReaderBuilder does not align with documentation #4570

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

Closed
fabiomolignoni opened this issue Apr 2, 2024 · 1 comment

Comments

@fabiomolignoni
Copy link
Contributor

fabiomolignoni commented Apr 2, 2024

Bug description
The class JdbcCursorItemReaderBuilder does not set a default value for the boolean property ignoreWarnings. Consequently, ignoreWarnings implicitly defaults to false. When the method build() is invoked, the value false is assigned to the JdbcCursorItemReader's ignoreWarnings variable.

This behavior deviates from the expected one as described in the Spring Batch Database documentation, which states:

ignoreWarnings: Determines whether or not SQLWarnings are logged or cause an exception. The default is true (meaning that warnings are logged).

The proposed solution is to set the default value of ignoreWarnings to true. This adjustment ensures that if the parameter is not explicitly set, warnings will be only logged, aligning with the documented behavior.

@fmbenhassine
Copy link
Contributor

Thank you for raising this. Indeed, the default value of the flag on the builder is not consistent with the one on the reader.

@fmbenhassine fmbenhassine added in: infrastructure and removed status: waiting-for-triage Issues that we did not analyse yet labels Apr 15, 2024
@fmbenhassine fmbenhassine added this to the 5.2.0-M1 milestone Apr 16, 2024
FBibonne pushed a commit to FBibonne/spring-batch that referenced this issue Feb 2, 2025
Resolves spring-projects#4570

Signed-off-by: Fabrice Bibonne <fabrice.bibonne@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants