Skip to content

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

Open
rzo1 wants to merge 1 commit into
masterfrom
OPENJPA-2989
Open

rzo1 wants to merge 1 commit 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
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