나는 struts 1.3, Hibernate3 및 Spring 보안으로 개발 된 웹 응용 프로그램을 가지고 있습니다. 이 응용 프로그램은 MySQL이 그 시간 이후에 연결을 종료 한 이후 8 시간이 지난 후에 이전에 죽었습니다. 그런 다음 몇 가지 게시물에서 정보를 수집하여 오래 전부터 거의 20 ~ 24 시간 동안 유지합니다. 어떤 몸이라도이 일을하도록 나를 도울 수 있습니까? 활동 20 시간 후 로그인 할 수없는c3p0을 사용하는 동안 MySQL의 최대 절전 모드 연결 문제
요약
스피. 연결은 MySQL에 의해 닫힙니다.
감사합니다.
최대 절전 모드 및 c3p0 구성에 대한 아래 내용을 확인하십시오.
최대 절전 모드 CFG 파일 조각은 봄부터 구성
<property name="hibernate.dialect">se.etm.ewo.hibernate.CustomDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">MY_JDBC_URL?autoReconnect=true</property>
<property name="hibernate.connection.username">username</property>
<property name="hibernate.connection.password">password</property>
<property name="hibernate.connection.autoReconnect">true</property>
<property name="hibernate.connection.autoReconnectForPools">true</property>
<property name="hibernate.c3p0.idle_test_period">100</property>
<property name="hibernate.c3p0.preferredTestQuery">select 1</property>
<property name="hibernate.c3p0.testWhileIdle">true</property>
<property name="hibernate.c3p0.testConnectionOnCheckout">true</property>
<property name="hibernate.c3p0.min_size">10</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">update</property>
<property name="hibernate.current_session_context_class">thread</property>
조각
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation">
<value>classpath:hibernate.cfg.xml</value>
</property>
<property name="hibernateProperties">
<ref bean="hibernateProperties" />
</property>
</bean>
<bean id="hibernateProperties"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="ignoreResourceNotFound" value="true" />
<property name="location">
<value>classpath:hibernate.cfg.xml</value>
</property>
</bean>
<!-- Data source -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="jdbcUrl">
<value>MY_JDBC_URL?autoReconnect=true</value>
</property>
<property name="user">
<value>username</value>
</property>
<property name="password">
<value>password</value>
</property>
<property name="initialPoolSize">
<value>10</value>
</property>
<property name="maxPoolSize">
<value>30</value>
</property>
<property name="minPoolSize">
<value>10</value>
</property>
<property name="maxConnectionAge">
<value>3600</value>
</property>
<property name="maxIdleTime">
<value>3600</value>
</property>
<property name="maxIdleTimeExcessConnections">
<value>1800</value>
</property>
<property name="acquireRetryAttempts">
<value>3</value>
</property>
<property name="acquireRetryDelay">
<value>3000</value>
</property>
<property name="breakAfterAcquireFailure">
<value>false</value>
</property>
<property name="preferredTestQuery">
<value>SELECT 1</value>
</property>
<property name="testConnectionOnCheckout">
<value>true</value>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
C3P0는 로그인
정보 추상 PoolBackedDataSource : 462 - c3p0 풀 초기화 중 ... com.mchange.v2.c3p0.ComboPooledDataSource [acquireIncrement -> 3, acquireRetryAttempts -> 3, acquireRetryDelay -> 3000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1br9tik951qql1qj1z141xq | 2a868f36, debugUnreturnedConnectionStackTraces -> true, description -> null, driverClass -> com.mysql.jdbc .Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1br9tik951qql1qj1z141xq | 2a868f36, idleConnectionTestPeriod -> 0, initialPoolSize -> 10, jdbcUrl -> jdbc : mysql : // url? autoReconnect = true, lastAcquisitionFailureDefaultUser -> null, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 3600, maxIdleTime -> 3600, maxIdleTimeExcessConnections -> 1800, maxPoolSize -> 30, maxStatements -> 0, maxStatement sPerConnection -> 0, minPoolSize -> 10, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> SELECT 1, 속성 -> {사용자 = ******, 암호 = ******}, propertyCycle -> 0, testConnectionOnCheckin -> 거짓, testConnectionOnCheckout -> 사실, unreturnedConnectionTimeout -> 300, usesTraditionalReflectiveProxies -> 거짓]
C3P0 로그가 정확히이 라인을 보면, 문제와 관련된 아무것도 프로그래머 없습니다. 아무것도 찾을 수 있니?
안녕 스티브 감사합니다. 나는 이것을 확인하고 다시 연락 할 것이다. –
안녕 내가 찾은 로그를 확인해 주시겠습니까? 나는 질문의 하단에있는 로그를 업데이 트했습니다. 무엇이든 찾으면 답장 해주세요. 인증은 사실이지만 역할은 익명입니다. –
게시 한 로그 중 c3p0 관련 로그가 없습니다. c3p0의 설정을 원한다면 풀 init의 INFO에 "com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource"라는 로거에 의해 덤프됩니다. 일반적인 사용을 위해 com.mchange 이하를 모두 INFO 수준으로 로깅해야합니다. –