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.  [ 3 posts ] 
Author Message
 Post subject: Problem with Connection obtained from a Session
PostPosted: Thu Dec 08, 2005 3:57 pm 
Newbie

Joined: Wed Jan 26, 2005 8:05 am
Posts: 13
Hi guys,
I have a problem with Hibernate in WebSphere 6.0.2 server environment.
I use a DataSource from WebSphere.
Sometimes I need to get a Connection from the Hibernate Session Object.
I get it like this:
Connection conn = session.connection();

After I perform a regular JDBC operations with PreparedStatements
and ResultSet.

I would like to know do I have to close the obtained Connection
like conn.close or just close the
Session object in a finally block

finally {
session.close();
}

Does anybody have an idea about
I use Hibernate version: 2.1

Thank you

Skyrose


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 08, 2005 4:18 pm 
Regular
Regular

Joined: Tue Oct 28, 2003 8:25 am
Posts: 72
Location: Belgium
Don't close the connection yourself, the session will take care of this.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 09, 2005 5:53 pm 
Newbie

Joined: Mon Jul 18, 2005 10:15 am
Posts: 17
Just curious - why do you need to get the connection out of a Hibernate session?
JB


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.