Problem description: a legacy project, which has a super slow query, need to check about three to four hours or so, which involves the union of multi-table and sub aggregate functions such as operations, the question is: if in executing the SQL database server is no problem, can normal execution, is slow, but if you have another execute the SQL server over time (about 2 hours or so), will appear the following exceptions:
Com.mysql.jdbc.exceptions.jdbc4.Com municationsException: Communications link failure
The last packet successfully received from The server was 7875323 milliseconds line. The last packet sent successfully to The server was 7875002 milliseconds line.
At sun. Reflect. NativeConstructorAccessorImpl. NewInstance0 (Native Method)
At sun. Reflect. NativeConstructorAccessorImpl. NewInstance (NativeConstructorAccessorImpl. Java: 57)
At sun. Reflect. DelegatingConstructorAccessorImpl. NewInstance (DelegatingConstructorAccessorImpl. Java: 45)
The at Java. Lang. Reflect. Constructor. NewInstance (526) Constructor. Java:
At com. Mysql. JDBC. Util. HandleNewInstance (Util. Java: 406)
At com. Mysql. JDBC. SQLError. CreateCommunicationsException (SQLError. Java: 1074)
At com. Mysql. JDBC. MysqlIO. ReuseAndReadPacket (MysqlIO. Java: 3030)
At com. Mysql. JDBC. MysqlIO. ReuseAndReadPacket (MysqlIO. Java: 2916)
At com. Mysql. JDBC. MysqlIO. CheckErrorPacket (MysqlIO. Java: 3459)
At com. Mysql. JDBC. MysqlIO. SendCommand (MysqlIO. Java: 1957)
At com. Mysql. JDBC. MysqlIO. SqlQueryDirect (MysqlIO. Java: 2107)
At com. Mysql. JDBC. ConnectionImpl. ExecSQL (ConnectionImpl. Java: 2648)
At com. Mysql. JDBC. PreparedStatement. ExecuteInternal (PreparedStatement. Java: 2086)
At com. Mysql. JDBC. PreparedStatement. Execute (PreparedStatement. Java: 1365)
At com. Alibaba. Druid. Filter. FilterChainImpl. PreparedStatement_execute (FilterChainImpl. Java: 3005)
At com. Alibaba. Druid. Filter. FilterEventAdapter. PreparedStatement_execute (FilterEventAdapter. Java: 440)
At com. Alibaba. Druid. Filter. FilterChainImpl. PreparedStatement_execute (FilterChainImpl. Java: 3003)
At com. Alibaba. Druid. Filter. FilterEventAdapter. PreparedStatement_execute (FilterEventAdapter. Java: 440)
At com. Alibaba. Druid. Filter. FilterChainImpl. PreparedStatement_execute (FilterChainImpl. Java: 3003)
At com. Alibaba. Druid. Filter. FilterEventAdapter. PreparedStatement_execute (FilterEventAdapter. Java: 440)
At com. Alibaba. Druid. Filter. FilterChainImpl. PreparedStatement_execute (FilterChainImpl. Java: 3003)
At com. Alibaba. Druid. Proxy. JDBC. PreparedStatementProxyImpl. Execute (PreparedStatementProxyImpl. Java: 136)
At com. Alibaba. Druid. Pool. DruidPooledPreparedStatement. Execute (DruidPooledPreparedStatement. Java: 493)
At sun. Reflect. NativeMethodAccessorImpl. Invoke0 (Native Method)
At sun. Reflect. NativeMethodAccessorImpl. Invoke (NativeMethodAccessorImpl. Java: 57)
At sun. Reflect. DelegatingMethodAccessorImpl. Invoke (43) DelegatingMethodAccessorImpl. Java:
The at Java. Lang. Reflect. Method. Invoke (606) Method. The Java:
The at org. Apache. Ibatis. Logging. JDBC. PreparedStatementLogger. Invoke (55) PreparedStatementLogger. Java:
At com. Sun. Proxy. $Proxy95. Execute (Unknown Source)
The at org. Apache. Ibatis. Executor. Statement. PreparedStatementHandler. Query (PreparedStatementHandler. Java: 56)
The at org. Apache. Ibatis. Executor. Statement. RoutingStatementHandler. Query (RoutingStatementHandler. Java: 70)
The at org. Apache. Ibatis. Executor. SimpleExecutor. DoQuery (SimpleExecutor. Java: 57)
The at org. Apache. Ibatis. Executor. BaseExecutor. QueryFromDatabase (BaseExecutor. Java: 259)
The at org. Apache. Ibatis. Executor. BaseExecutor. Query (BaseExecutor. Java: 132)
The at org. Apache. Ibatis. Executor. CachingExecutor. Query (CachingExecutor. Java: 105)
The at org. Apache. Ibatis. Executor. CachingExecutor. Query (CachingExecutor. Java: 81)
The at org. Apache. Ibatis. Session. Defaults. DefaultSqlSession. SelectList (DefaultSqlSession. Java: 104)
The at org. Apache. Ibatis. Session. Defaults. DefaultSqlSession. SelectList (DefaultSqlSession. Java: 98)
At sun. Reflect. NativeMethodAccessorImpl. Invoke0 (Native Method)
At sun. Reflect. NativeMethodAccessorImpl. Invoke (NativeMethodAccessorImpl. Java: 57)
At sun. Reflect. DelegatingMethodAccessorImpl. Invoke (43) DelegatingMethodAccessorImpl. Java:
The at Java. Lang. Reflect. Method. Invoke (606) Method. The Java:
The at org. Mybatis. Spring. SqlSessionTemplate $SqlSessionInterceptor. Invoke (SqlSessionTemplate. Java: 354)
At com. Sun. Proxy. $Proxy16. SelectList (Unknown Source)
The at org. Mybatis. Spring. SqlSessionTemplate. SelectList (SqlSessionTemplate. Java: 194)
The at org. Apache. Ibatis. Binding. MapperMethod. ExecuteForMany (MapperMethod. Java: 114)
The at org. Apache. Ibatis. Binding. MapperMethod. Execute (58) MapperMethod. Java:
The at org. Apache. Ibatis. Binding. MapperProxy. Invoke (43) MapperProxy. Java:
At com. Sun. Proxy. $Proxy91. GetSBUDay (Unknown Source)
At com. Jy. Quartz. SBUJob. Work (SBUJob. Java: 38)
At com. Jy. Quartz. SBUJob. Start (SBUJob. Java: 29)
At com. Jy. Quartz. Clarify. Start (78) to Clarify. Java:
At sun. Reflect. NativeMethodAccessorImpl. Invoke0 (Native Method)
At sun. Reflect. NativeMethodAccessorImpl. Invoke (NativeMethodAccessorImpl. Java: 57)
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull