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

Batch sequences generate unordered ids, which results in unordered instances returned by JobExplorer [BATCH-2177] #1422

Closed
spring-projects-issues opened this issue Feb 14, 2014 · 0 comments

Comments

@spring-projects-issues
Copy link
Collaborator

Przemysław Wojnowski opened BATCH-2177 and commented

JobExplorer.getJobInstances() returns instances ordered descending by ID, but ids generated by sequences are unordered, so also job instances are unordered (newer job may have lower ID than older job).
The problem is that provided DDL doesn't specify order on sequences and Oracle sequences are unordered by default.

To fix that DDL for sequences has to have ORDER specified. This will ensure that job ids reflect their creation order, which is very important when one wants to find the last successful job execution to do incremental export.

The first line of macro in oracle10g.vpp sholud be:

#macro (sequence $name $value)CREATE SEQUENCE ${name} START WITH ${value} MINVALUE 0 MAXVALUE 9223372036854775807 ORDER NOCYCLE;

The issue probably affects also newer versions.

If there is any reason why the sequences are unordered please let me know.


Affects: 2.1.9

Reference URL: http://forum.spring.io/forum/spring-projects/batch/744526-passing-last-successful-export-date-to-sql-where-clause

@fmbenhassine fmbenhassine added this to the 5.0.0 milestone Jan 26, 2021
@fmbenhassine fmbenhassine changed the title Batch sequences generate unordered ids, which relusts in unordered instances returned by JobExplorer [BATCH-2177] Batch sequences generate unordered ids, which results in unordered instances returned by JobExplorer [BATCH-2177] Jan 26, 2021
@fmbenhassine fmbenhassine modified the milestones: 5.0.0, 5.0.0-M1 Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants