-->
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.  [ 1 post ] 
Author Message
 Post subject: C3P0 too slow to connect in remote MySQL database
PostPosted: Wed Nov 26, 2014 3:40 pm 
Newbie

Joined: Wed Nov 26, 2014 3:31 pm
Posts: 1
Some months ago, i posted a thread in stackoverflow (http://stackoverflow.com/questions/24027719/c3p0-more-faster-in-eclipse-and-more-slow-in-jar) and since then could not solve my problem. When I'm with local connection, the C3P0 works very well, and when I want to connect to a remote database, it takes 15-25 seconds to connect to the database. In Eclipse, the connection is only 6 seconds because Eclipse create 4 connection threads. But in Jar system exist a 15-25 seconds delay =\

My settings in hibernate.cfg.xml is below:

Code:
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
      <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
      
      <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>      
      <property name="hibernate.c3p0.min_size">5</property>
        <property name="hibernate.c3p0.max_size">2000</property>
        <property name="hibernate.c3p0.initial_pool_size">5</property>
        <property name="hibernate.c3p0.min_pool_size">1</property>
        <property name="hibernate.c3p0.max_pool_size">50</property>
        <property name="hibernate.c3p0.timeout">300</property>
        <property name="hibernate.c3p0.max_statements">180</property>
       
        <property name="hibernate.c3p0.maxIdleTime">1800</property>
        <property name="hibernate.c3p0.acquire_increment">4</property>
       
        <!--
        <property name="hibernate.c3p0.numHelperThreads">10</property>
        <property name="hibernate.c3p0.idle_test_period">200</property>
        -->
       
        <property name="preferredTestQuery">SELECT 1</property>
       
        <property name="temp.use_jdbc_metadata_defaults">false</property>      
      <property name="hibernate.show_sql">true</property>   


My boss not like my work, and do not want to create a web full application, and already have a desktop system and it's working, but the connection is very slow =(

Can anyone help me on this?

Thanks in Advanced and sorry for my bad English. I'm from Brazil.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.