2012-07-07 2 views
1
우리는 MySQL의 5.1 바람둥이 6.0.26을 사용하는

는 데이터베이스로의 연결이 server.xml에 설정 절전 모드를 유지톰캣 폐쇄하지 연결, 아래로

<GlobalNamingResources> 
<!-- Editable user database that can also be used by 
    UserDatabaseRealm to authenticate users 
--> 
<Resource name="UserDatabase" auth="Container" 
      type="org.apache.catalina.UserDatabase" 
      description="User database that can be updated and saved" 
      factory="org.apache.catalina.users.MemoryUserDatabaseFactory" 
      pathname="conf/tomcat-users.xml" /> 

<Resource name="jdbc/abs" type="javax.sql.DataSource" maxActive="150" maxIdle="5" username="XXXXXXXXXXX" testWhileIdle="true" removeAbandonedTimeout="60" maxWait="-1" removeAbandoned="true" 
    validationQuery="select 1" driverClassName="com.mysql.jdbc.Driver" password="XXXXXXXXXXX" minEvictableIdleTimeMillis="30000" timeBetweenEvictionRunsMillis="300000" url="jdbc:mysql://XXXXXXXXXXXX?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8"/> 

    <Resource driverClassName="com.mysql.jdbc.Driver" maxActive="150" maxIdle="5" maxWait="-1" testWhileIdle="true" minEvictableIdleTimeMillis="30000" removeAbandonedTimeout="60" timeBetweenEvictionRunsMillis="300000" name="jdbc/1234" password="XXXXXXXXXXX" removeAbandoned="true" type="javax.sql.DataSource" url="jdbc:mysql:///XXXXXXXXXXXXXXXXXXXXXX?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8" username="XXXXXXXXXXX" validationQuery="select 1"/> 

나는 그것이 슬립 모드에 남아있는 연결을 많이 보여줍니다 MySQL에서 쇼 전체 processlist를 실행,이 원인이 될 수 있을까?

감사합니다,

Rohit

+0

동일한 문제가 발생합니다. 문제를 해결할 수 있었습니까? –

답변

-1

javax.sql.DataSource는 MySQL로 연결 풀이다. 응용 프로그램 서버는 MySQL에 대한 일부 연결을 열고 (잠자기 모드로 유지됨) 다음을 수행 할 때마다 사용합니다.

DataSource ds = ...; 
// you get one of the 'sleeping' connections here 
Connection conn = ds.getConnection(); 
// you return the connection to the pool here (it does not actually closes it) 
conn.close();