-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: After session.close(), session.connection() still works
PostPosted: Fri Aug 20, 2004 4:51 am 
Newbie

Joined: Fri Aug 20, 2004 4:32 am
Posts: 1
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!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 03, 2004 10:43 am 
Newbie

Joined: Thu Jun 24, 2004 2:19 am
Posts: 10
Hibernate Version: 2.14 and 2.16

The same here.
After Session.close(): Session.connection() returns a Connection and does not throw an HibernateException.
And also after Session.close() i can call Session.reconnect() and the Exception i get is: "Session already connected"
(while i was expecting something like: "session closed. can not reconnect").


pascal


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.