StatelessSession should have an isOpen() method
-----------------------------------------------
Key: HHH-2949
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2949
Project: Hibernate3
Issue Type: Improvement
Components: core
Affects Versions: 3.2.5, 3.1.3
Environment: Hibernate 3.1.3 (also affects 3.2.5 i believe), DB2 version 8
Reporter: Bjørn Skogseth
Priority: Minor
StatelessSession.close() throws an exception if called multiple times on the same
instance, just as Session.close() does. However, as the interface does not have an
isOpen() method, there is no way to check if the call is safe. This means that in code
where you don't know if the session has been closed properly, but just want to make
sure it is closed, you have to wrap the close() call in a try/catch block and then ignore
any SessionException that is thrown by the close method. Alternatively one can cast the
instance to StatelessSessionImpl and then call the isOpen method there, which is public.
Neither of these solutions are satisfactory.
To resolve this, I suggest that the isOpen() method is added to the StatelessSession
interface.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira