spring-projects / spring-batch

Spring Batch is a framework for writing batch applications using Java and Spring
http://projects.spring.io/spring-batch/
Apache License 2.0
2.63k stars 2.3k forks source link

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

Closed fabiomolignoni closed 1 month ago

fabiomolignoni commented 2 months ago

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 commented 1 month ago

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