Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: config c3p0 which create to many connection

  1. #1

    Default config c3p0 which create to many connection

    Dear All,
    I am using c3p0 to solve the problem that server will inactive after 8 hours. However, When I using c3po I have new issue that it's create too many sleeping connection. This is my mysql5.hibernate.cfg.xml file
    <hibernate-configuration><session-factory>
    <!--
    hibernate c3p0 settings
    -->
    <property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
    <property name="hibernate.c3p0.acquire_increment">3</property>
    <property name="hibernate.c3p0.idle_test_period">10</property>
    <property name="hibernate.c3p0.min_size">5</property>
    <property name="hibernate.c3p0.max_size">75</property>
    <property name="hibernate.c3p0.maxIdleTime">1800</property>
    <property name="hibernate.c3p0.max_statements">0</property>
    <property name="hibernate.c3p0.timeout">25200</property>
    <property name="hibernate.c3p0.preferredTestQuery">select 1</property>
    <property name="hibernate.c3p0.testConnectionOnCheckout">true</property>
    <!--
    hibernate cache settings
    -->
    <property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
    <property name="hibernate.generate_statistics">true</property>
    <property name="hibernate.cache.use_query_cache">true</property>
    <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="connection.url">jdbc:mysql://localhost:3306/hibernate</property>
    <property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
    <property name="connection.username">root</property>
    <property name="connection.password">password</property>
    <property name="connection.pool_size">10</property>
    <property name="show_sql">false</property>
    <property name="hibernate.jdbc.use_streams_for_binary">true</property>
    <property name="hibernate.hbm2ddl.auto">update</property>
    <mapping resource="hibernate/mysql5innodb.hbm.xml"/>
    <mapping resource="PentahoUser.hbm.xml"/>
    <mapping resource="PentahoRole.hbm.xml"/>
    <mapping resource="PentahoUserRoleMapping.hbm.xml"/>
    </session-factory>
    </hibernate-configuration>

    I execute a "SHOW PROCESSLIST" command and it show too many Sleep connection.How can I fix this problem ?

    185 | root | localhost:52944 | hibernate | Sleep | 8 | | NULL

    thankyou very much
    Last edited by sacpv04; 05-20-2013 at 11:12 PM.

  2. #2

    Default

    Dear all,

    We don't have any ways to solve this problem ? I don't know why pentaho create to many Sleep connections.
    success-ss

  3. #3
    Join Date
    Dec 2009
    Posts
    609

    Default

    Hi,

    as you never specified what is "too many" from your point of view, it´s hard to assist.

    Maybe reducing the number in:
    <property name="hibernate.c3p0.max_size">75</property>

    might help?

    Cheers,

    Tom

  4. #4

    Default

    Dear Tom
    thank you for your help and my config.xml is fixed. However I still dont understand the different between the hibernate.c3p0.max_size and the max_Active in mysql. Is there any problem if I set max_active =100 but max_size = 10
    thankyou
    success-ss

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.