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.