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

Sorting in JdbcJobExecutionDao.GET_RUNNING_EXECUTIONS makes no sense #3987

Closed
marschall opened this issue Sep 1, 2021 · 1 comment
Closed

Comments

@marschall
Copy link
Contributor

JdbcJobExecutionDao#GET_RUNNING_EXECUTIONS currently has order by E.JOB_EXECUTION_ID desc however JdbcJobExecutionDao#findRunningJobExecutions(String) returns a HashSet therefore the iteration order is undefined. We should either

  • remove the order by
  • return a TreeSet
@marschall marschall added the status: waiting-for-triage Issues that we did not analyse yet label Sep 1, 2021
@fmbenhassine
Copy link
Contributor

Thank you for raising this. The contract of JobExecutionDao#findRunningJobExecutions does not specify the order in which running executions are returned (hence the Set return type). So clients should not be expecting any order or any sorted data structure. I think the order by clause is irrelevant here and could be removed.

@fmbenhassine fmbenhassine added in: core type: enhancement and removed status: waiting-for-triage Issues that we did not analyse yet labels Sep 8, 2021
@fmbenhassine fmbenhassine added this to the 5.0.0 milestone Sep 8, 2021
marschall added a commit to marschall/spring-batch that referenced this issue Sep 9, 2021
Remove the sorting from JdbcJobExecutionDao#GET_RUNNING_EXECUTIONS
because #findRunningJobExecutions returns an unsorted HashSet.

Issue spring-projects#3987
marschall added a commit to marschall/spring-batch that referenced this issue Jan 21, 2022
Remove the sorting from JdbcJobExecutionDao#GET_RUNNING_EXECUTIONS
because #findRunningJobExecutions returns an unsorted HashSet.

Issue spring-projects#3987
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