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.  [ 4 posts ] 
Author Message
 Post subject: Issue On Hibernate...
PostPosted: Thu May 15, 2008 5:12 am 
Newbie

Joined: Wed Apr 30, 2008 6:13 am
Posts: 11
Hi All,

I have one application using Hibernate and Spring.When i am deploying in Tomcat and trying to access my application its giving me the result.But the problem is if i ll access the application repeatedly 4th time its not giing me any response.Neither nay error nor any response.


When i i have added one debug point and try to get the problem what i saw: its going to the DAO implementation class and in that i have one method there i have written one HQL to get the result.There only its stuck when i am accessing forth time.

Its not giving me any error.See the code below.

List list = getHibernateTemplate().find(
"from com.ifs.app.model.adaptors.CodeDescConfigAdaptor where entityCode="
+ "'" + entityCode + "'");
if (list.size() > 0)
codeDescConfigAdaptor = (CodeDescConfigAdaptor) list.get(0);
return codeDescConfigAdaptor;


Application is hanging in that point where i have marked as bold.



Can anybody help me on this issue.

Thnx in advance.



Regards
Debapriya


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 15, 2008 6:58 am 
Expert
Expert

Joined: Thu Jul 05, 2007 9:38 am
Posts: 287
First guess: you are not closing your Session including the underlying jdbc connection and run out of connections.

If this doesn't apply: debugg into the hibernate code to see where it gets stuck.

_________________
Please rate useful posts.


Schauderhaft: Softwaredevelopment, Projectmanagement, Qualitymanagement and all things "schauderhaft"


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 15, 2008 8:36 am 
Newbie

Joined: Wed Apr 30, 2008 6:13 am
Posts: 11
Actually i am using JNDI connection to connect the database.And that is in spring configuration file.
so where i should close the session.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 16, 2008 4:00 pm 
Expert
Expert

Joined: Thu Jul 05, 2007 9:38 am
Posts: 287
http://www.hibernate.org/hib_docs/core/ ... on-release

You can configure when the jdbc connection is released
- after each statment
- on commit
- on (hibernate)session close.

So at the very least you should have a session.close() somewhere, and it should actually get executed of course.

_________________
Please rate useful posts.


Schauderhaft: Softwaredevelopment, Projectmanagement, Qualitymanagement and all things "schauderhaft"


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