2014-11-11 2 views
0
내가 4 를 최대 절전 모드 나 최대 절전 모드 3에서 마이그레이션 자바 응용 프로그램 에서 MySQL 데이터베이스와 최대 절전 모드 사용하지만 바쁜 스레드의 새로운 최대 절전 모드 수를 증가하고 그래서 내 응용 프로그램 작동이 중지 연결 모두 사용

더 이상 연결할 수 없습니다. 내 hibernate.cfg 구성은 울부 짖는 소리입니다 :연결이 열려 4 세션을 최대 절전 모드

 <property name="dialect">org.hibernate.dialect.MySQLDialect</property> 
     <!-- Enable Hibernate's automatic session context management --> 
     <property name="current_session_context_class">thread</property> 
     <property name="hibernate.current_session_context_class">thread</property> 
     <!-- Disable the second-level cache --> 
     <property name="hibernate.cache.use_second_level_cache">true</property> 
     <!--<property name="hibernate.cache.provider_class"> 
      net.sf.ehcache.hibernate.EhCacheProvider 
     </property>--> 
     <property name="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory</property> 
     <property name="hibernate.cache.use_query_cache">true</property> 

     <!--<property name="hibernate.generate_statistics">true</property>--> 

     <!--C3P0 configure--> 
     <property name="hibernate.connection.provider_class"> 
      org.hibernate.connection.C3P0ConnectionProvider 
     </property> 
     <property name="hibernate.c3p0.acquire_increment">3</property> 
     <property name="hibernate.c3p0.idle_test_period">144</property> 
     <property name="hibernate.c3p0.timeout">60</property> 
     <property name="hibernate.c3p0.max_size">30</property> 
     <property name="hibernate.c3p0.min_size">3</property> 
     <property name="hibernate.c3p0.max_statements">0</property> 
     <property name="hibernate.c3p0.preferredTestQuery">select 1;</property> 
     <property name="hibernate.c3p0.validate">true</property> 
     <property name="hibernate.c3p0.testConnectionOnCheckout">true</property> 

내가 시간 제한에게 작은 값을 설정하고 MAX_SIZE 을 증가시키고 또한 = 거짓 을 use_second_level_cache 설정하지만 개선 문제

이 무엇인지

을 이루어지지 않습니다

덕분에 많이

답변

0

이것은 응용 프로그램의 Connection leak과 매우 비슷합니다. c3p0 구성 매개 변수 unreturnedConnectionTimeoutdebugUnreturnedConnectionStackTraces을 사용하여 디버깅하십시오.

here을 참조하십시오.

(당신의 hibernate.cfg 그들은 hibernate.c3p0.unreturnedConnectionTimeouthibernate.c3p0.debugUnreturnedConnectionStackTraces이 될 것입니다.)