You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BATCH-2465: add note about the importance to have a unique key
constraint on the sortKey
This PR is for BATCH-2465.
It updates the reference documentation and the Javadoc to mention
explicitly the importance to have a unique key constraint on the sortKey
when using paging item readers.
I deliberately used "It is important" and not "It is required" (or
mandatory) because in the end this is not required but in that case
there is no guarantee to not lose data between executions.
Please let me know if the wording should be updated.
Copy file name to clipboardExpand all lines: spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/JdbcPagingItemReader.java
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2006-2013 the original author or authors.
2
+
* Copyright 2006-2018 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -51,7 +51,8 @@
51
51
* needed as {@link #read()} method is called, returning an object corresponding
52
52
* to current position. On restart it uses the last sort key value to locate the
53
53
* first page to read (so it doesn't matter if the successfully processed items
54
-
* have been removed or modified).
54
+
* have been removed or modified). It is important to have a unique key constraint on the
55
+
* sort key to guarantee that no data is lost between executions.
Copy file name to clipboardExpand all lines: spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/AbstractSqlPagingQueryProvider.java
0 commit comments