| As a result of a major redesign in Hibernate 5.x, the LogicalConnectionImplementor implementation classes were introduced. These classes now have the property of releasing JDBC resources on logical transaction commit through the ResourceRegistryStandardImpl (via implementations of org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor#afterTransaction). This includes closing all ResultSets which were created inside the transaction even though the ResultSets where created with over-commit holdability (java.sql.ResultSet#HOLD_CURSORS_OVER_COMMIT). Pre 5.x Hibernate did not have this issue as org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction#doCommit did not close the ResultSets and allowed the ResultSets to be open until Session close. Please consider respecting the holdability setting and allowing the ResultSet to outlive the transaction scope. |