[hibernate-issues] [JIRA] (HHH-13872) Make the Java Stream close the underlying ScrollableResultsIterator upon calling a terminal operation

Vlad Mihalcea (JIRA) jira at hibernate.atlassian.net
Thu Feb 20 04:15:39 EST 2020


Vlad Mihalcea ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Af5e8c0d3-3aae-4bb4-a4e1-25463d60d232 ) *created* an issue

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiODUxMTI3YzMxNGVjNDE2OWFhMjZkODlkYzJlNGNiMzciLCJwIjoiaiJ9 ) / Improvement ( https://hibernate.atlassian.net/browse/HHH-13872?atlOrigin=eyJpIjoiODUxMTI3YzMxNGVjNDE2OWFhMjZkODlkYzJlNGNiMzciLCJwIjoiaiJ9 ) HHH-13872 ( https://hibernate.atlassian.net/browse/HHH-13872?atlOrigin=eyJpIjoiODUxMTI3YzMxNGVjNDE2OWFhMjZkODlkYzJlNGNiMzciLCJwIjoiaiJ9 ) Make the Java Stream close the underlying ScrollableResultsIterator upon calling a terminal operation ( https://hibernate.atlassian.net/browse/HHH-13872?atlOrigin=eyJpIjoiODUxMTI3YzMxNGVjNDE2OWFhMjZkODlkYzJlNGNiMzciLCJwIjoiaiJ9 )

Issue Type: Improvement Affects Versions: 5.4.12 Assignee: Vlad Mihalcea ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Af5e8c0d3-3aae-4bb4-a4e1-25463d60d232 ) Components: hibernate-core Created: 20/Feb/2020 01:15 AM Fix Versions: 5.4.13 Priority: Major Reporter: Vlad Mihalcea ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Af5e8c0d3-3aae-4bb4-a4e1-25463d60d232 )

The JPA 2.2 Query#getResultStream returns a Stream wrapping a Hibernate ScrollableResultsIterator.

However, even if a terminal Stream operation is called, the underlying ScrollableResultsIterator will stay open until the Session is closed.

More, the current implementation does not pass the closeHandler to the IntStream , LongStream , or DoubleStream when calling mapToInt or other methods that return a primitive stream.

We need to create a StreamDecorator , IntStreamDecorator , LongStreamDecorator , and DoubleStreamDecorator that can both delegate the stream calls and close the stream upon executing a terminal operation.

( https://hibernate.atlassian.net/browse/HHH-13872#add-comment?atlOrigin=eyJpIjoiODUxMTI3YzMxNGVjNDE2OWFhMjZkODlkYzJlNGNiMzciLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-13872#add-comment?atlOrigin=eyJpIjoiODUxMTI3YzMxNGVjNDE2OWFhMjZkODlkYzJlNGNiMzciLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100121- sha1:b179e60 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200220/df344f64/attachment-0001.html 


More information about the hibernate-issues mailing list