What’s new in JPA 2.2 – Stream the result of a Query execution

Introduction In this article, we are going to see how the JPA 2.2 Stream query results are supported by Hibernate and the caveats of using database cursors just to limit the amount of data that needs to be fetched. Reason for streaming Probably one of the most expected JPA 2.2 features, Streaming query results was added for the following reasons: Reading large datasets using JPA is quite uncomfortable these days as all method signatures return Lists, which causes the entire `ResultSet` to be pulled into memory before it can be handed to … Continue reading What’s new in JPA 2.2 – Stream the result of a Query execution