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: disconnect or close session
PostPosted: Wed Jan 24, 2007 5:10 am 
Newbie

Joined: Tue Sep 26, 2006 10:51 am
Posts: 6
Location: Berlin, Germany
Hi,
I use hibernate with pooled DB connection.
For each call (read/write) I start a new transaction and comit if all is fine or rollback when it fails.
Does not matter from result, in finally block, I always close a session.

My question are:

1. should I close session or better is to disconnect it ?
2. What is disconned method for ?
3. Is there any documentation which covers close/disconnect aproach (I cannot find any) ?

Cheers,
Albert


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 24, 2007 8:07 am 
Newbie

Joined: Sun Jan 21, 2007 10:56 pm
Posts: 14
here is some reference on hibernate session

http://www.hibernate.org/42.html


in short you don't need to manually manage your session. Hibernate can take care of it for you. However you can if you want to.



hth,


pali


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 24, 2007 9:00 am 
Newbie

Joined: Tue Sep 26, 2006 10:51 am
Posts: 6
Location: Berlin, Germany
Hi,

Thanks pali for response.

I have to manage session since I use framework which to obtain a session just opens one.
My question was what is the difference (in live) between disconnect and close session in pooled DB connection.
I found that at least I have disconnect but I have some problems (expecially update - aobject with the same id was already associated with the session) when I disconnect from session only.

WHat is the difference for performance between those 2 methods ?

Regards,
Albert

_________________
Albert Gorski agorski(at/)gmx(dot/)net


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.