-->
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.  [ 2 posts ] 
Author Message
 Post subject: org.hibernate.HibernateException: Not able to obtain connect
PostPosted: Sat Oct 22, 2005 10:28 am 
Beginner
Beginner

Joined: Wed Mar 17, 2004 12:44 am
Posts: 25
I am getting the following exception. Please let me know the reason for this.


Hibernate version: 3.0.5

Mapping documents:
<property name="strProductid" column="str_ProductID" type="string" />
<property name="txtFiles" column="txt_Files" type="string" />
<property name="txtClip" column="txt_Clip" type="string" />
<property name="strScreen" column="str_Screen" type="string" />
<property name="strMedium" column="str_Medium" type="string" />
<property name="strTitle" column="str_Title" type="string" />
<property name="strSubtitle" column="str_Subtitle" type="string" />
<property name="intPresid" column="int_PresID" type="integer" />
<property name="relPriceretail" column="rel_PriceRetail" type="double" />
<property name="relPricemember" column="rel_PriceMember" type="double" />
<property name="txtDesfile" column="txt_DESfile" type="string" />
<property name="txtTocfile" column="txt_TOCfile" type="string" />
<property name="relLength" column="rel_Length" type="double" />
<property name="intCeus" column="int_CEUs" type="integer" />
<property name="txtCertfile" column="txt_CertFile" type="string" />
<property name="intCertid" column="int_CertID" type="integer" />
<property name="intNoofviews" column="int_NoOfViews" type="integer" />
<property name="intNoofdays" column="int_NoOfDays" type="integer" />
<property name="strPptfile" column="str_PPTFile" type="string" />
<property name="intAssid" column="int_ASSID" type="integer" />
<property name="strPresentertype" column="str_PresenterType" type="string" />


Code between sessionFactory.openSession() and session.close():
public List getProduct(String productId) {
return HibernateSessionFactory.currentSession().createQuery("From TblProduct where strProductid = " + productId).list();
}


Full stack trace of any exception that occurs:
org.hibernate.HibernateException: Not able to obtain connection
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:113)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:88)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1162)
at org.hibernate.loader.Loader.doQuery(Loader.java:390)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
at org.hibernate.loader.Loader.doList(Loader.java:1593)
at org.hibernate.loader.Loader.list(Loader.java:1577)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at com.abc.capital.util.AddUpdateProduct.getProduct(AddUpdateProduct.java:17)
at org.apache.jsp.question_jsp._jspService(org.apache.jsp.question_jsp:88)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Name and version of the database you are using:MySql 4.0

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 22, 2005 12:15 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
are there any pauses associated w/ this error? does it happen throughout the application, or only in the same place? does it come later if you increase the size of the connection pool? if the answer to any of these is yes, retrace yout steps and make sure you are calling Session.close() properly.


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