Skip to content

Query caching not working for getResultStream()? #1397

Answered by jwgmeligmeyling
famod asked this question in Q&A
Discussion options

You must be logged in to vote

Although we completely delegate this to Hibernates query caching, I would indeed expect Hibernate to not cache result streams, as constructing a list of values in memory in order to write this to a cache would defeat the purpose of streaming.

If you want to use the Steam API without actually streaming the result, and thus allowing query caching, I recommend using getResultList().stream()

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@beikov
Comment options

@famod
Comment options

Answer selected by beikov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants