jdbc4 CommunicationsException

Ich habe einen Computer, auf dem eine Java-App ausgeführt wird, die mit einer MySQL-Instanz kommuniziert, die auf derselben Instanz ausgeführt wird. Die App verwendet JDBC4-Treiber von MySQL. Ich erhalte immer wieder gelegentlich com.mysql.jdbc.exceptions.jdbc4.CommunicationsException.

Hier ist die ganze Nachricht.

Die JDBC-Verbindung konnte nicht für die Transaktion geöffnet werden. verschachtelte Ausnahme ist

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was25899 milliseconds ago.The last packet sent successfully to the server was 25899 milliseconds ago, which  is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.

Für mysql ist der Wert für globales 'wait_timeout' und 'interactive_timeout' auf 3600 Sekunden und für 'connect_timeout' auf 60 Sekunden festgelegt. Der Wert für das Wartezeitlimit ist viel höher als die 26 Sekunden (25899 ms). in der Ausnahmeverfolgung erwähnt.

Ich benutze Dbcp für das Verbindungs-Pooling und hier ist Spring Bean Config für die Datenquelle.

   <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource" >
          <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
                    <property name="url" value="jdbc:mysql://localhost:3306/db"/>
                <property name="username" value="xxx"/>
                <property name="password" value="xxx" />
                    <property name="poolPreparedStatements" value="false" />
            <property name="maxActive" value="3" />
            <property name="maxIdle" value="3" />
    </bean>

Irgendeine Idee, warum das passieren könnte? Wird c3p0 das Problem lösen?

Antworten auf die Frage(4)

Ihre Antwort auf die Frage