ScrollableResultsImpl.next() does not check if ResultSet is closed

Description

Hi,

In org.hibernate.query.internal.ScrollableResultsIterator there is

 

I use the DB2 driver jcc-11.5.0.0.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?

Regards,
Uwe

Environment

None

Assignee

Unassigned

Reporter

Uwe Voigt

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure