-->
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.  [ 1 post ] 
Author Message
 Post subject: Inactive session on databse side while using hibernate
PostPosted: Wed Oct 07, 2009 8:36 am 
Newbie

Joined: Wed Oct 07, 2009 7:56 am
Posts: 1
Hi Everybody,
I have used hibernate in my application. I am getting problem as when i log out from the application the session remains inactive and some cursor are open but after some some time the count of cursor and inactive session get reduced. Is there any way so that after logging out the session get completely close. In each method i have used

Session session=HibernateSessionFactory.getSessionFactory().openSession();
try {
trnx=session.beginTransaction();
\\ some line of code for querying db

trnx.commit();
}
catch(Exception e){
if(trnx!=null)
trnx.rollback();
log.error(e.getMessage(),e);
throw e;
}
finally{
try{
session.flush();
HibernateSessionFactory.closeSession();
}catch (HibernateException e) {
log.error(e.getMessage(),e);
throw e;
}
}


Please suggest to get rid of this issue.

Thanks..
Ajit


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

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.