Skip to content
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

JdbcPagingItemReader [BATCH-2465] #1137

Closed
spring-projects-issues opened this issue Jan 20, 2016 · 2 comments
Closed

JdbcPagingItemReader [BATCH-2465] #1137

spring-projects-issues opened this issue Jan 20, 2016 · 2 comments
Labels
has: backports Legacy label from JIRA. Superseded by "for: backport-to-x.x.x" in: documentation type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

cm opened BATCH-2465 and commented

if sortKeys is't unique key, the query sql(remainingPagesSql)---'select a,b,c from table where c>? limit 2' can lose data,for example:
a b c
1 2 1
2 2 2
3 3 2
4 5 3
the third row will lose.
remainingPagesSql --- 'select a,b,c from table limit pageSize*(pageNo-1),pageSize' and the last querySql --- 'select a,b,c from table limit pageSize*(pageNo-1),the sum of the table - pageSize*pageNo' is OK?


Affects: 3.0.6

Referenced from: pull request #568, and commits 9bd7c1b, 54f3a5c

Backported to: 3.0.9

@spring-projects-issues
Copy link
Collaborator Author

Michael Minella commented

This isn't a bug. It's how it's designed. After reviewing the documentation, I guess we don't explicitly state that anywhere from what I can find. We can update the documentation accordingly.

@spring-projects-issues
Copy link
Collaborator Author

Mahmoud Ben Hassine commented

@ Michael Minella I do confirm, I can't find any information about that in the documentation neither.

Just for the record, I add a reference to a related question on the forum here: http://forum.spring.io/forum/spring-projects/batch/89552-problem-in-jdbcpagingitemreader-with-timestamp-as-sortkey

Based on the reply by Dave Syer, I will update the reference documentation and the Javadoc to mention that it is important to have a unique key constraint on the sort key to guarantee that no data is lost between executions.

@spring-projects-issues spring-projects-issues added type: bug has: backports Legacy label from JIRA. Superseded by "for: backport-to-x.x.x" in: documentation labels Dec 16, 2019
@spring-projects-issues spring-projects-issues added this to the 4.0.1 milestone Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has: backports Legacy label from JIRA. Superseded by "for: backport-to-x.x.x" in: documentation type: bug
Projects
None yet
Development

No branches or pull requests

1 participant