Skip to content

Fix MongoJobInstanceDao to comply with JobInstanceDao contract#5275

Open
combe4259 wants to merge 1 commit intospring-projects:mainfrom
combe4259:GH-5274
Open

Fix MongoJobInstanceDao to comply with JobInstanceDao contract#5275
combe4259 wants to merge 1 commit intospring-projects:mainfrom
combe4259:GH-5274

Conversation

@combe4259
Copy link

Closes gh-5274

MongoJobInstanceDao has two issues:

  1. getJobNames() uses findAll() which loads all documents into memory without deduplication or sorting. The JobInstanceDao interface contract requires distinct, alphabetically sorted names. Replaced with findDistinct() with sorting.

  2. getJobInstances() fetches all matching documents and paginates in Java. Replaced with MongoDB skip() and limit().

Use findDistinct() with sorting in getJobNames() to return
deduplicated and alphabetically sorted names, consistent with
the JDBC implementation and the JobInstanceDao interface contract.

Use MongoDB skip() and limit() in getJobInstances() to delegate
pagination to the database instead of performing it in memory.

Closes spring-projectsgh-5274

Signed-off-by: combe4259 <combe4259@naver.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MongoJobInstanceDao: getJobNames() violates interface contract and getJobInstances() performs pagination in memory

1 participant