Query caching not working for getResultStream()
?
#1397
-
Hi, is it to be expected that
does use query caching but
doesn't? |
Beta Was this translation helpful? Give feedback.
Answered by
jwgmeligmeyling
Dec 1, 2021
Replies: 1 comment 2 replies
-
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() |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
beikov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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()