Skip to content

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

Closed

Description

@spring-projects-issues

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

Activity

  1. added this to the 5.0.0 milestone on Jan 26, 2021
  2. 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][/+] on Jan 26, 2021
  3. modified the milestones: 5.0.0, 5.0.0-M1 on Sep 17, 2021
  4. added a commit that references this issue on Mar 2, 2024
    ef81b67
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions