Connection cannot be closed without closing a resultset if fetching is not done, close() hangs

Description

I think it's a minor issue because JDBC does not explicitly state that Connection.close() must close a statement and result sets; but in the current state it's particularly error-prone, and hanging isn't good, so if it's possible, it would be good to fix. MySQL Connector/J doesn't show this problem.

The following test case sets a non-zero fetch size for a statement and then executes a query with a sizable enough result set. Before all values are fetched, the connection gets closed, but the operation never ends.

Test case:

Stack trace:

Environment

None

Assignee

Vladislav Vaintroub

Reporter

Elena Stepanova

Labels

None

Fix versions

Affects versions

Priority

Minor
Configure