If using the HibernateThreadFilter and setting the Hibernate property hibernate.current_session_context_class to thread, I'm confused as to whether I need to manually unbind the the Session and close it. I see at
http://hibernate.org/42.html it says the "current" Session is automatically closed when the transaction is committed, but at
http://blog.hibernate.org/cgi-bin/blosx ... ioncontext it says I need to manually unbind and close the Session. In my logs Hibernate seems to log some confusing messages, telling me that the session is closed and then again reminding me to close the session. This log output was from a simple HelloWorld example that ran a single select for the request.
DEBUG [org.hibernate.jdbc.JDBCContext] 208 - <after transaction completion>
2006-09-08 05:24:42,765 DEBUG [org.hibernate.jdbc.ConnectionManager] 296 - <transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!>
2006-09-08 05:24:42,765 DEBUG [org.hibernate.impl.SessionImpl] 424 - <after transaction completion>
2006-09-08 05:24:42,765 DEBUG [org.hibernate.impl.SessionImpl] 355 - <automatically closing session>
2006-09-08 05:24:42,765 DEBUG [org.hibernate.impl.SessionImpl] 275 - <closing session>
2006-09-08 05:24:42,765 DEBUG [org.hibernate.jdbc.ConnectionManager] 374 - <performing cleanup>
2006-09-08 05:24:42,765 DEBUG [org.hibernate.jdbc.ConnectionManager] 435 - <releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]>
2006-09-08 05:24:42,765 DEBUG [org.hibernate.jdbc.JDBCContext] 208 - <after transaction completion>
2006-09-08 05:24:42,765 DEBUG [org.hibernate.jdbc.ConnectionManager] 296 - <transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!>
2006-09-08 05:24:42,765 DEBUG [org.hibernate.impl.SessionImpl] 424 - <after transaction completion>