-->
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.  [ 6 posts ] 
Author Message
 Post subject: C3P0 exception.... very strange!!!!
PostPosted: Tue Nov 29, 2005 7:41 pm 
Beginner
Beginner

Joined: Fri Aug 20, 2004 3:45 pm
Posts: 22
Location: Florence - ITALY
I obtain the exception below after 5 reload of the same web page.
This error happens ONLY with hibernate 3.1RC3.. NOT with hibernate3.1RC2.
In spring DAO access forum, suggest me to ask in hibernate forum.
Possible bug?

Thanks.
Gianni


Hibernate version: 3.1RC3

Mapping documents:
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="com.mysql.jdbc.Driver"/>
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/anagrafe"/>
<property name="user" value="root"/>
<property name="password" value=""/>
<property name="acquireRetryAttempts" value="30" />
</bean>

Full stack trace of any exception that occurs:
Hibernate: select ente0_.id_ente as id1_2_, ente0_.descr_ente as descr2_2_, ente0_.codiceistatcomune as codiceis3_2_, ente0_.data_agg_zindice as data4_2_ from enti ente0_
- Theme created: name 'theme', basename [theme]
- Using Jakarta JSTL ExpressionEvaluatorManager
Hibernate: select ente0_.id_ente as id1_2_, ente0_.descr_ente as descr2_2_, ente0_.codiceistatcomune as codiceis3_2_, ente0_.data_agg_zindice as data4_2_ from enti ente0_
Hibernate: select ente0_.id_ente as id1_2_, ente0_.descr_ente as descr2_2_, ente0_.codiceistatcomune as codiceis3_2_, ente0_.data_agg_zindice as data4_2_ from enti ente0_
Hibernate: select ente0_.id_ente as id1_2_, ente0_.descr_ente as descr2_2_, ente0_.codiceistatcomune as codiceis3_2_, ente0_.data_agg_zindice as data4_2_ from enti ente0_
Hibernate: select ente0_.id_ente as id1_2_, ente0_.descr_ente as descr2_2_, ente0_.codiceistatcomune as codiceis3_2_, ente0_.data_agg_zindice as data4_2_ from enti ente0_
- SQL Error: 0, SQLState: null
- SQL Error: 0, SQLState: null
- An attempt by a client to checkout a Connection has timed out.
- An attempt by a client to checkout a Connection has timed out.
- SQL Error: 0, SQLState: null
- SQL Error: 0, SQLState: null
- An attempt by a client to checkout a Connection has timed out.
- An attempt by a client to checkout a Connection has timed out.
- Could not complete request
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open user connection
org.hibernate.exception.GenericJDBCException: Cannot open user connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.JDBCContext.userConnection(JDBCContext.java:117)
at org.hibernate.impl.SessionImpl.connection(SessionImpl.java:364)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:407)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:281)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:217)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy1.getEnti(Unknown Source)
at it.tdgroup.anagrafe.actions.SalvaEnteController.referenceData(SalvaEnteController.java:46)
at org.springframework.web.servlet.mvc.SimpleFormController.referenceData(SimpleFormController.java:209)
at org.springframework.web.servlet.mvc.AbstractFormController.showForm(AbstractFormController.java:538)
at org.springframework.web.servlet.mvc.SimpleFormController.showForm(SimpleFormController.java:193)
at org.springframework.web.servlet.mvc.SimpleFormController.showForm(SimpleFormController.java:172)
at org.springframework.web.servlet.mvc.AbstractFormController.showNewForm(AbstractFormController.java:321)
at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:261)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:347)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:696)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at it.tdgroup.anagrafe.authentication.AccessControlFilter.doFilter(AccessControlFilter.java:47)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:199)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:104)
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:234)
at com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(PoolBackedDataSource.java:94)
at com.mchange.v2.c3p0.ComboPooledDataSource.getConnection(ComboPooledDataSource.java:521)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:80)
at org.hibernate.jdbc.JDBCContext.userConnection(JDBCContext.java:114)
... 61 more
Caused by: com.mchange.v2.resourcepool.TimeoutException: internal -- timeout at awaitAcquire()
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAcquire(BasicResourcePool.java:968)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:208)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:232)
... 65 more


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 9:30 pm 
Senior
Senior

Joined: Mon Apr 04, 2005 8:04 am
Posts: 128
Location: Manchester, NH USA
Your code where you are opening and closing the connection?

I'd guess you are running out of connections in the pool because you are not closing them somehow.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 4:01 am 
Beginner
Beginner

Joined: Fri Aug 20, 2004 3:45 pm
Posts: 22
Location: Florence - ITALY
Spring should close connection for me using method destroy-method="close"
as you can see in bean definitions.

Gianni


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 4:03 am 
Beginner
Beginner

Joined: Fri Aug 20, 2004 3:45 pm
Posts: 22
Location: Florence - ITALY
Remenber.... my code works fine with Hibernate 3.1RC2 !!!!!

Gianni


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 01, 2005 4:34 pm 
Senior
Senior

Joined: Mon Apr 04, 2005 8:04 am
Posts: 128
Location: Manchester, NH USA
I have been recently getting this error too. What version of C3P0 are you using? I am using 0.9.2 with Hibernate 3.1 mainline (rc3+).


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 01, 2005 4:53 pm 
Beginner
Beginner

Joined: Fri Aug 20, 2004 3:45 pm
Posts: 22
Location: Florence - ITALY
I'm using C3P0 version 0.9.0, tha same included in Hibernate 3.1RC3.


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