Session.isOpen() throws exeception when the session is closed with ThreadLocalSessionContext

Description

Probably due to this improvement in 3.1.1: https://hibernate.atlassian.net/browse/HHH-1290#icft=HHH-1290 - Defensive checking of session status

Since Hibernate 3.1.1 Session.isOpen() and Session.close() throw execeptions when the session is closed.

Therefore the example described in the Session javadoc will now fail in the finally block even when the commit succeeds:
(see http://www.hibernate.org/hib_docs/v3/api/org/hibernate/Session.html)

The attached JUnit tests both work in Hibernate 3.1 and both fail in Hibernate 3.1.1.

Session.isOpen() should not throw an exception when the session is closed.

Attachments

4
  • 25 Jan 2006, 12:41 PM
  • 25 Jan 2006, 12:40 PM
  • 25 Jan 2006, 12:39 PM
  • 24 Jan 2006, 07:13 PM

relates to

Activity

Show:

Steve Ebersole March 21, 2011 at 7:00 PM

Closing stale resolved issues

Steve Ebersole January 25, 2006 at 3:52 PM

Ah, you are using the ThreadLocal-based current session stuff. That is a different case than what we currently test. It is important to include all relevant info winking face

Adrian Fletcher January 25, 2006 at 12:41 PM

Surefire report for test success (Hibernate 3.1)

Adrian Fletcher January 25, 2006 at 12:40 PM

Surefire report for test failure (Hibernate 3.1.1)

Adrian Fletcher January 25, 2006 at 12:39 PM

Attached a maven project that reproduces this issue. Changing the dependency in the pom from hibernate 3.1.1 to 3.1 causes the tests to pass.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created January 24, 2006 at 7:13 PM
Updated March 21, 2011 at 7:00 PM
Resolved January 26, 2006 at 7:23 AM

Flag notifications