CommunicationsException: Communications link failure

一笑奈何 提交于 2019-11-29 11:17:55

The problem are solved. It is because the result is too huge. In my query , i used the default cursor, which is client-side cursors, This means, the whole resultant recordset of a SELECT is returned to the client (application) and the paging is done there. So the total result set is too big and make jdbc client out of memory. The solution is that:

  1. add "useCursorFetch=true" to JDBC URL configuration parameters
  2. call statement.setFetchSize(100)

You can read more detail from : http://wiki.gxtechnical.com/commwiki/servlet/hwiki?Client%20and%20server%20cursors%20-%20using%20MySQL

This might happen when you try to commit with stale connection. Try checking for the connection state before doing the commit.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!