Skip to content

[OPENJPA-2989] Add a compatibility option to restore lazy query result lists - #196

Merged
cristof merged 3 commits into
masterfrom
OPENJPA-2989
Sep 28, 2026
Merged

cristof merged 3 commits into
masterfrom
OPENJPA-2989

Conversation

@rzo1

@rzo1 rzo1 commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Since the Jakarta Persistence 3.2 work Query.getResultList() copies the kernel ResultList into an ArrayList, so results are always fully materialized and openjpa.FetchBatchSize no longer streams rows to the caller (measured: with a batch size the kernel returns a lazy WindowResultList which the copy drains). The eager copy came from TCK compliance work rather than a spec clause we could cite, so it stays the default and the new MaterializeQueryResultList compatibility option restores the lazy list. The migration guide now spells out the memory implication and documents the option.

…t lists

Query.getResultList() copies the kernel ResultList into an ArrayList since
the Jakarta Persistence 3.2 work, so the complete result is materialized and
openjpa.FetchBatchSize no longer streams rows to the caller. Keep that as the
default and add the MaterializeQueryResultList compatibility option, which
restores the lazy ResultList for applications that rely on streaming, and
document the memory implication in the migration considerations.
@rzo1 rzo1 self-assigned this Sep 26, 2026
@rzo1
rzo1 requested review from cristof and solomax September 26, 2026 17:51
@cristof
cristof merged commit d5a3d31 into master Sep 28, 2026
4 checks passed
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.

3 participants