-->
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.  [ 10 posts ] 
Author Message
 Post subject: Question regarding connections
PostPosted: Thu Oct 19, 2006 6:07 am 
Beginner
Beginner

Joined: Mon Aug 02, 2004 7:28 am
Posts: 38
Hibernate version: 3

If a java.sql.Connection wrapped by a Hibernate Session and is closed by some other code, does any extra work need to be done on the Hibernate Session to close it down?

i.e. does the Session hold extra "hooks" on the database etc?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 3:30 am 
Beginner
Beginner

Joined: Mon Aug 02, 2004 7:28 am
Posts: 38
Would someone be so kind and please give me an answer.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 3:34 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
If your posting (or a question you are referring to) was not answered by anybody, the possible reasons are:

- http://www.hibernate.org/ForumMailingli ... AskForHelp
- You did not submit enough information
- Nobody knows the answer or has the free time to answer

What you can do now:

- Do the things listed in After Posting
- Add missing and/or more information
- Consider commercial support for guaranteed expert response times

This is a high-traffic forum run by volunteers with hundreds of postings made every day. The community works because people try to help others in their free time. Nobody is paid for this service or has to pay.

You should not expect a timely response and you should not rely on a public community forum for critical cases.

All community members should respect the rules of this forum and treat others like they would prefer to be treated.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 8:10 am 
Beginner
Beginner

Joined: Mon Aug 02, 2004 7:28 am
Posts: 38
Thanks Max,

I did search the forum and docs but could not find anything that answered my question directly.

Anyway, I'll keep searching.

Thanks again for the reply.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 8:22 am 
Regular
Regular

Joined: Wed Jul 27, 2005 2:33 am
Posts: 118
Does this help:

http://www.hibernate.org/117.html#A12


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 10:42 am 
Beginner
Beginner

Joined: Mon Aug 02, 2004 7:28 am
Posts: 38
Thanks Jaikiran,

I had a look at that link, but it didn't really told me what I wanted to know, however, I did find an answer in the Javadocs. Session.close() and Session.disconnect() methods.

Thanks for your help.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 10:54 am 
Beginner
Beginner

Joined: Mon Aug 02, 2004 7:28 am
Posts: 38
Sorry guys, I spoke to my manager and that's not really the answer. The questions is: If the application that passed the connection to Hibernate, closes the connection, do I still need to call session.close() or session.disconnect(), to be sure that all references to the java.sql.Connection are being removed.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 11:01 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you should always call session.close() (if you don't need the session anymore)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 11:53 am 
Beginner
Beginner

Joined: Mon Aug 02, 2004 7:28 am
Posts: 38
If I create a session, providing my own java.sql.Connection, then close the connection and clear all pointers to the session.

What would be the implication be of doing this over and over again in the same JVM. Does it keep some sort of resources with regard to the database?

Let me know if this is unclear.

Thanks again.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 24, 2006 9:40 am 
Beginner
Beginner

Joined: Mon Aug 02, 2004 7:28 am
Posts: 38
Guys,

Just to clarify, your answers were helpful, but didn't solve the problem.


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