Skip to content

Replace EntityListIterator.hasNext() with next()-based iteration for performance#1163

Merged
dixitdeepak merged 2 commits into
apache:trunkfrom
dixitdeepak:eli_has_next
May 5, 2026
Merged

Replace EntityListIterator.hasNext() with next()-based iteration for performance#1163
dixitdeepak merged 2 commits into
apache:trunkfrom
dixitdeepak:eli_has_next

Conversation

@dixitdeepak
Copy link
Copy Markdown
Contributor

Improved: Updated iteration logic to avoid using EntityListIterator.hasNext(), which is inefficient due to JDBC ResultSet behavior.

  • Replaced hasNext() checks with next() != null pattern
  • Aligned with recommended usage in EntityListIterator JavaDoc
  • Prevented unnecessary ResultSet cursor operations and warning logs
  • Improved iteration performance and reduced overhead

Example:
while ((value = iterator.next()) != null) { ... }

…performance

Updated iteration logic to avoid using EntityListIterator.hasNext(), which is inefficient due to JDBC ResultSet behavior.

- Replaced hasNext() checks with next() != null pattern
- Aligned with recommended usage in EntityListIterator JavaDoc
- Prevented unnecessary ResultSet cursor operations and warning logs
- Improved iteration performance and reduced overhead

Example:
while ((value = iterator.next()) != null) { ... }
@dixitdeepak dixitdeepak merged commit 9fd008f into apache:trunk May 5, 2026
5 checks passed
@dixitdeepak dixitdeepak deleted the eli_has_next branch May 7, 2026 10:22
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.

1 participant