[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6891) Hibernate is not reusing connections from the pool

Shawn Clowater (JIRA) noreply at atlassian.com
Tue Apr 3 15:19:51 EDT 2012


    [ https://hibernate.onjira.com/browse/HHH-6891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46172#comment-46172 ] 

Shawn Clowater commented on HHH-6891:
-------------------------------------

That's similar behaviour as HHH-7120, i.e. it may already be fixed.  I'm using C3P0 and I'm no longer exhausting my connection pool, Joseph, you may want to try rolling up to 4.1.2 when it becomes available or even grab the snapshot and run with that.

> Hibernate is not reusing connections from the pool
> --------------------------------------------------
>
>                 Key: HHH-6891
>                 URL: https://hibernate.onjira.com/browse/HHH-6891
>             Project: Hibernate ORM
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 4.0.0.CR7
>         Environment: Hibernate 4, MySQL 5.6
>            Reporter: Mat Banik
>              Labels: c3p0, dbcp, hibernate
>         Attachments: test_case.zip
>
>
> I have tried two connection pool providers C3P0 and Commons DBCP. Both are the most current versions. 
> Everything starts fine. And data is loading from database as expected.
> But with C3P0 when left to defaults everything stops when maximum of 15 connections are reached. Nothing is freed up and the application behaves like it has memory leak.
> Here is bottom of log output
> 2011-12-13/17:21:55.167/EST [http-bio-80-exec-2] DEBUG begin
> 2011-12-13/17:21:55.167/EST [http-bio-80-exec-2] DEBUG Obtaining JDBC connection
> 2011-12-13/17:21:55.167/EST [http-bio-80-exec-2] DEBUG acquire test -- pool is already maxed out. [managed: 15; max: 15]
> 2011-12-13/17:21:55.167/EST [http-bio-80-exec-2] DEBUG awaitAvailable(): com.mchange.v2.c3p0.impl.NewPooledConnection at 46f0decc
> 2011-12-13/17:21:55.167/EST [http-bio-80-exec-2] DEBUG trace com.mchange.v2.resourcepool.BasicResourcePool at 9671641 [managed: 15, unused: 0, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection at 46f0decc)
> With Commons DBCP everything work as well until when maximum connections are reached and than it throws exception:
> org.springframework.orm.hibernate4.HibernateJdbcException: JDBC exception on Hibernate data access: SQLException for SQL [n/a]; SQL state [null]; error code [0]; Could not open connection; nested exception is org.hibernate.exception.GenericJDBCException: Could not open connection org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:165) org.springframework.orm.hibernate4.HibernateExceptionTranslator.convertHibernateAccessException(HibernateExceptionTranslator.java:50) org.springframework.orm.hibernate4.HibernateExceptionTranslator.translateExceptionIfPossible(HibernateExceptionTranslator.java:37) org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:58) org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213) org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:163) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the hibernate-issues mailing list