In org.hibernate.query.internal.ScrollableResultsIterator there is
I use the DB2 driver jcc-22.214.171.124.jar which autocloses the result set after the last row has been fetched (https://www.ibm.com/support/pages/invalid-operation-result-set-closed-error-data-server-driver-jdbc)
Now, if I use a Stream<Entity> as return type of method returning the result of a query, the JDBCException from org.hibernate.internal.ScrollableResultsImpl.next() is thrown inside my lambda evaluation.
I would suggest that inside next() there would be a call to resultSet.isClosed() just like
What do you think?