Hi all,
When i did a test for hibernate session's implementation, i got a small problem:
Although i have closed the session by calling session.close(), it is still possible to get a non-null value from calling session.connection(). From my point of view, after calling session.close(), the session can't do further interesting things, that is, it should throw an exception when calling session.connection(). The following is my test code snippets:
Hibernate version: 2.1.4
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Session sess = sessionFactory.openSession();
Connection conn = sess.connection();
assertTrue(conn != null); //ok
sess.disconnect();
sess.reconnect();
sess.close();
conn = sess.connection();
assertTrue(conn != null); //sess is close, but we still get a connection!
Name and version of the database you are using: Oracle 8i
Thanks!
|