Соединение MySQL с сервером wait_timeout составляет 28800 секунд, мои приложения в спящем режиме продолжают время ожидания (весь жизненный цикл приложения составлял около 1 часа).
The last packet successfully received from the server was 4,396,266 milliseconds ago. The last packet sent successfully to the server was 4,405,476 milliseconds ago.
hibernate использует следующие свойства c3p0, я не понимаю, почему истекло время ожидания, даже если все приложение работало около 1 часа, а время простоя должно быть намного меньше этого.Принимая во внимание, что время ожидания соединения hibernate составляет 5000 секунд, плюс он проверяет наличие простоя каждые 300 секунд, почему это произошло?
<property name="hibernate.c3p0.min_size">0</property>
<property name="hibernate.c3p0.max_size">200</property>
<property name="hibernate.c3p0.idle_test_period">300</property>
<property name="hibernate.c3p0.timeout">5000</property>
обновление: подробная ошибка msg:
Caused by: java.sql.BatchUpdateException: Communications link failure
The last packet successfully received from the server was 5,980,742 milliseconds ago. The last packet sent successfully to the server was 5,9\
87,659 milliseconds ago.
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2024)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1449)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:56)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2421)
... 15 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 5,980,742 milliseconds ago. The last packet sent successfully to the server was 5,9\
87,659 milliseconds ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3358)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1970)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2150)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2415)
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1976)
... 20 more
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3339)