Vlad Mihalcea (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiODUxMTI3YzMx...
) / Improvement (
https://hibernate.atlassian.net/browse/HHH-13872?atlOrigin=eyJpIjoiODUxMT...
) HHH-13872 (
https://hibernate.atlassian.net/browse/HHH-13872?atlOrigin=eyJpIjoiODUxMT...
) Make the Java Stream close the underlying ScrollableResultsIterator upon calling a
terminal operation (
https://hibernate.atlassian.net/browse/HHH-13872?atlOrigin=eyJpIjoiODUxMT...
)
Issue Type: Improvement Affects Versions: 5.4.12 Assignee: Vlad Mihalcea (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) 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%...
)
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=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-13872#add-comment?atlOrigin=ey...
)
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....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100121- sha1:b179e60 )