Psycopata, brigadão.
Não visitei o fórum porque estive impossibilitado de trabalhar no caso desde terça passada.
O problema é de conexao mesmo, pois coloquei debug em tudo no meu log4j.properties e veja só o que percebi no momento que ele trava:
12:42:13,671 DEBUG SessionImpl:220 - opened session at timestamp: 12160501336
12:42:13,671 DEBUG JDBCTransaction:54 - begin
12:42:13,671 DEBUG ConnectionManager:415 - opening JDBC connection
12:42:13,671 DEBUG BasicResourcePool:942 - awaitAvailable(): com.mchange.v2.c3p0.impl.NewPooledConnection@3eae3da8
12:42:13,671 DEBUG BasicResourcePool:1159 - trace com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6 [managed: 20, unused: 0, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@3eae3da8)
12:42:27,658 DEBUG BasicResourcePool:1286 - Checking for expired resources - Mon Jul 14 12:42:27 BRT 2008 [com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6]
12:42:50,158 DEBUG BasicResourcePool:1286 - Checking for expired resources - Mon Jul 14 12:42:50 BRT 2008 [com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6]
12:43:12,658 DEBUG BasicResourcePool:1286 - Checking for expired resources - Mon Jul 14 12:43:12 BRT 2008 [com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6]
12:43:25,144 DEBUG BasicResourcePool:1341 - Refurbishing idle resources - Mon Jul 14 12:43:25 BRT 2008 [com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6]
12:43:25,144 DEBUG BasicResourcePool:1159 - trace com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6 [managed: 20, unused: 0, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@3eae3da8)
12:43:35,158 DEBUG BasicResourcePool:1286 - Checking for expired resources - Mon Jul 14 12:43:35 BRT 2008 [com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6]
12:43:57,658 DEBUG BasicResourcePool:1286 - Checking for expired resources - Mon Jul 14 12:43:57 BRT 2008 [com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6]
12:44:20,158 DEBUG BasicResourcePool:1286 - Checking for expired resources - Mon Jul 14 12:44:20 BRT 2008 [com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6]
12:44:42,658 DEBUG BasicResourcePool:1286 - Checking for expired resources - Mon Jul 14 12:44:42 BRT 2008 [com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6]
12:45:05,145 DEBUG BasicResourcePool:1341 - Refurbishing idle resources - Mon Jul 14 12:45:05 BRT 2008 [com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6]
12:45:05,145 DEBUG BasicResourcePool:1159 - trace com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6 [managed: 20, unused: 0, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@3eae3da8)
12:45:05,158 DEBUG BasicResourcePool:1286 - Checking for expired resources - Mon Jul 14 12:45:05 BRT 2008 [com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6]
12:45:27,658 DEBUG BasicResourcePool:1286 - Checking for expired resources - Mon Jul 14 12:45:27 BRT 2008 [com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6]
12:45:50,158 DEBUG BasicResourcePool:1286 - Checking for expired resources - Mon Jul 14 12:45:50 BRT 2008 [com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6]
12:46:12,658 DEBUG BasicResourcePool:1286 - Checking for expired resources - Mon Jul 14 12:46:12 BRT 2008 [com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6]
12:46:35,158 DEBUG BasicResourcePool:1286 - Checking for expired resources - Mon Jul 14 12:46:35 BRT 2008 [com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6]
12:46:45,145 DEBUG BasicResourcePool:1341 - Refurbishing idle resources - Mon Jul 14 12:46:45 BRT 2008 [com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6]
12:46:45,145 DEBUG BasicResourcePool:1159 - trace com.mchange.v2.resourcepool.BasicResourcePool@2a6c9ec6 [managed: 20, unused: 0, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@3eae3da8)
12:46:57,658 DEBUG BasicResourcePool:1286 - Checking for expired resources - Mon Jul 14 12:46:57 BRT 2008
Pelo que eu entendi, nas primeiras linhas ele o hibernate abre uma sessao, entra no código da implementação do JDBC, e depois quando o c3p0 vai resolver questões sobre o pool de conexões, aí dá pau.:
BasicResourcePool:942 - awaitAvailable(): com.mchange.v2.c3p0.impl.NewPooledConnection@3eae3da8
Estou colocando o meu hibernate.cfb onde faço a configuração do c3p0 pra vcs verem se estou fazendo alguma burrada.
<!-- ***** C O N F I G U R A C O N E X A O COM MYSQL NO LOCALHOST **** -->
<!-- USUARIO -->
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">adminfocri</property>
<!-- CONEXAO -->
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/bancodedadoscri</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<!-- ****************************************************************** -->
<!-- DIALETOS -->
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
<!-- property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property-->
<!-- CONFIGURACOES ADICIONAIS -->
<!-- property name="hibernate.show_sql">true</property -->
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<!-- CONF DO POOL DE CONEXOES ((NAO UTILIZAR O NATIVO DO HIBERNATE DE JEITO NENHUM -->
<property name="c3p0.min_size">5</property> <!-- numero minimo de conexoes abertas no servidor-->
<property name="c3p0.max_size">20</property> <!-- numero maximo de conexoes abertas no servidor -->
<property name="c3p0.timeout">180</property> <!-- tempo limite para resolver conexoes -->
<property name="c3p0.max_maxIdleTime">300</property> <!-- o mesmo que timeout e nao se usa mais -->
<property name="c3p0.idle_test_period">100</property> <!-- NAO ME LEMBRO AGORA... -->
<!-- ***** M A P E A M E N T O S **** -->
====================================================================
Mas fica uma pergunta no ar…(quer dizer neste POST),
Por que será que tem tantas conexoes no banco assim?
O fato delas estarem “sleep” não quer dizer que estariam disponíveis para o c3p0?