BATCH-2465: add note about the importance to have a unique key constraint on the sortKey

This commit is contained in:
Mahmoud Ben Hassine
2018-01-25 11:02:02 +01:00
committed by Michael Minella
parent 8af6841fa6
commit 54f3a5c837
3 changed files with 12 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2013 the original author or authors.
* Copyright 2006-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,7 +51,8 @@ import org.springframework.util.ClassUtils;
* needed as {@link #read()} method is called, returning an object corresponding
* to current position. On restart it uses the last sort key value to locate the
* first page to read (so it doesn't matter if the successfully processed items
* have been removed or modified).
* have been removed or modified). It is important to have a unique key constraint
* on the sort key to guarantee that no data is lost between executions.
* </p>
*
* <p>
@@ -71,6 +72,7 @@ import org.springframework.util.ClassUtils;
* @author Thomas Risberg
* @author Dave Syer
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 2.0
*/
public class JdbcPagingItemReader<T> extends AbstractPagingItemReader<T> implements InitializingBean {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2012 the original author or authors.
* Copyright 2006-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,11 +42,14 @@ import org.springframework.util.StringUtils;
* Provides properties and preparation for the mandatory "selectClause" and
* "fromClause" as well as for the optional "whereClause". Also provides
* property for the mandatory "sortKeys". <b>Note:</b> The columns that make up
* the sort key must be a true key and not just a column to order by.
* the sort key must be a true key and not just a column to order by. It is important
* to have a unique key constraint on the sort key to guarantee that no data is lost
* between executions.
*
* @author Thomas Risberg
* @author Dave Syer
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 2.0
*/
public abstract class AbstractSqlPagingQueryProvider implements PagingQueryProvider {