Skip to content

Commit dbd2089

Browse files
fabiomolignonifmbenhassine
authored andcommitted
Set default ignoreWarnings to true in JdbcCursorItemReaderBuilder
Resolves #4570
1 parent 5a261fa commit dbd2089

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/JdbcCursorItemReaderBuilder.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 the original author or authors.
2+
* Copyright 2016-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,6 +37,7 @@
3737
* @author Mahmoud Ben Hassine
3838
* @author Ankur Trapasiya
3939
* @author Parikshit Dutta
40+
* @author Fabio Molignoni
4041
* @since 4.0
4142
*/
4243
public class JdbcCursorItemReaderBuilder<T> {
@@ -49,7 +50,7 @@ public class JdbcCursorItemReaderBuilder<T> {
4950

5051
private int queryTimeout = AbstractCursorItemReader.VALUE_NOT_SET;
5152

52-
private boolean ignoreWarnings;
53+
private boolean ignoreWarnings = true;
5354

5455
private boolean verifyCursorPosition = true;
5556

@@ -172,6 +173,11 @@ public JdbcCursorItemReaderBuilder<T> queryTimeout(int queryTimeout) {
172173
return this;
173174
}
174175

176+
/**
177+
* Set whether SQLWarnings should be ignored (only logged) or exception should be
178+
* thrown. Defaults to {@code true}.
179+
* @param ignoreWarnings if {@code true}, warnings are ignored
180+
*/
175181
public JdbcCursorItemReaderBuilder<T> ignoreWarnings(boolean ignoreWarnings) {
176182
this.ignoreWarnings = ignoreWarnings;
177183

0 commit comments

Comments
 (0)