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: Does session.close close the underlying JDBC statement
PostPosted: Fri Aug 05, 2005 3:19 pm 
Newbie

Joined: Thu Aug 04, 2005 5:52 pm
Posts: 3
If I get a JDBC exception, I want to make sure the database resources are released. Since I have read only queries. I am not using a transaction
and hence cannot call rollback or commit.
Instead I call session.close().
Is this going to gurantee that the JDBC statement is closed and associated database resources released ?


Top
 Profile  
 
 Post subject: Re: Does session.close close the underlying JDBC statement
PostPosted: Fri Aug 05, 2005 3:25 pm 
Beginner
Beginner

Joined: Tue Jul 12, 2005 10:27 am
Posts: 23
anjana wrote:
If I get a JDBC exception, I want to make sure the database resources are released. Since I have read only queries. I am not using a transaction
and hence cannot call rollback or commit.
Instead I call session.close().
Is this going to gurantee that the JDBC statement is closed and associated database resources released ?


It returns it back to the connection pool if you're using a connection pool. If you're not using a connection pool, I'm not really sure, but I think it closes off the connection.

_________________
- Richard Burton


Top
 Profile  
 
 Post subject: Re: Does session.close close the underlying JDBC statement
PostPosted: Fri Aug 05, 2005 4:32 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
anjana wrote:
If I get a JDBC exception, I want to make sure the database resources are released. Since I have read only queries. I am not using a transaction
and hence cannot call rollback or commit.
Instead I call session.close().
Is this going to gurantee that the JDBC statement is closed and associated database resources released ?


You realize the Hibernate distribution comes with ALL the code right ?

If you are using a debugger, it's easy to just step into the Hibernate code and see what's going on there. If not, you can just search the src tree.

And yes, if you're using a straight connection. It will be closed.

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


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.