Query.getResultList() returns a materialized ArrayList
Query.getResultList() previously returned a lazy org.apache.openjpa.lib.rop.ResultList wrapper that streamed rows on demand (see openjpa.FetchBatchSize) and became invalid when the query or the EntityManager was closed.
Jakarta Persistence 3.2 requires a mutable List, so the result is now copied into a java.util.ArrayList: all rows are fetched immediately, the list stays usable after the EntityManager is closed, and it is no longer an instance of ResultList. Query.getResultStream() also materializes the complete result first.
Large result set collections on entity fields (Large Result Set Proxies) are not affected.
The memory and performance implication is that the whole result set is held in memory at once: a query that previously streamed rows in openjpa.FetchBatchSize sized windows now allocates one list entry per row before getResultList() returns.
Applications that scan very large result sets should use setFirstResult() / setMaxResults() paging, or obtain the kernel query via OpenJPAQuery.getDelegate() for lazy semantics.
Code that casts the result to ResultList or DelegatingResultList must be changed.
Applications that depend on the previous streaming behaviour can restore it with the MaterializeQueryResultList compatibility option:
<property name="openjpa.Compatibility" value="MaterializeQueryResultList=false"/>
With the option disabled, Query.getResultList() again returns the lazy ResultList that honours openjpa.FetchBatchSize and becomes invalid once the query or the EntityManager is closed.
The option defaults to true, which is the behaviour since 4.2.0.