mysql dbcp data connection interrupted

 

mysql dbcp data connection interrupted,

The default connection wait_timeout of the dbcp connection pool is eight hours, so there are frequent interruptions in the production environment, so the configuration needs to be modified

The following is a more complete configuration

 

 

<bean id="dataSource"
            class="org.apache.commons.dbcp.BasicDataSource">
            <property name="driverClassName"
                value="com.mysql.jdbc.Driver">
            </property>
            <property name="url"
                value="jdbc:mysql://localhost:3306/test">
            </property>
            <property name="maxWait" value="20000">  </property>
            <property name="testOnBorrow" value="true"></property>
            <property name="testOnReturn" value="true"></property>
            <property name="testWhileIdle" value="true"></property>
            <property name="validationQuery" value="SELECT 1"></property>
            <property name="timeBetweenEvictionRunsMillis" value="3600000"></property>
            <property name="numTestsPerEvictionRun" value="50"></property>
            <property name="minEvictableIdleTimeMillis" value="120000"></property>
            <property name="removeAbandoned" value="true"/>
            <property name="removeAbandonedTimeout" value="6000000"/>
            <property name="username" value="root"></property>
            <property name="password" value="root"></property>
        </bean>

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326526602&siteId=291194637