Skip to content

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

Closed
@spring-projects-issues

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions