ScrollableResults#close throws an exception when called outside of a transaction
--------------------------------------------------------------------------------
Key: HHH-7297
URL:
https://hibernate.onjira.com/browse/HHH-7297
Project: Hibernate ORM
Issue Type: Bug
Components: core
Affects Versions: 3.6.9
Reporter: Ittay Dror
I have a repository class who is transactional but used by other classes that are not. One
of its methods returns a ScrollableResults object. Using this object works fine (outside
of a transaction), but calling close() throws an exception:
org.hibernate.SessionException: Session is closed!
at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:72)
~[hibernate-core-3.6.9.Final.jar:3.6.9.Final]
at org.hibernate.impl.SessionImpl.getBatcher(SessionImpl.java:305)
~[hibernate-core-3.6.9.Final.jar:3.6.9.Final]
at org.hibernate.impl.AbstractScrollableResults.close(AbstractScrollableResults.java:122)
~[hibernate-core-3.6.9.Final.jar:3.6.9.Final]
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira