{"id":235,"date":"2013-09-04T09:20:29","date_gmt":"2013-09-04T07:20:29","guid":{"rendered":"http:\/\/blog.daghosoft.com\/WP\/?p=235"},"modified":"2016-01-13T11:02:31","modified_gmt":"2016-01-13T10:02:31","slug":"solve-problem-with-mysql-closed-pool-by-server","status":"publish","type":"post","link":"https:\/\/blog.daghosoft.com\/WP\/solve-problem-with-mysql-closed-pool-by-server\/","title":{"rendered":"Solve problem with mysql closed pool by server"},"content":{"rendered":"<p>This configuration solve problem with following error:<\/p>\n<p><em><br \/>\norg.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.dao.RecoverableDataAccessException: PreparedStatementCallback; SQL XXXXXXXXXXXXXXXXXX; Communications link failure<\/p>\n<p>The last packet successfully received from the server was 30,184,929 milliseconds ago.  The last packet sent successfully to the server was 0 milliseconds ago.; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure<\/p>\n<p>The last packet successfully received from the server was 30,184,929 milliseconds ago.  The last packet sent successfully to the server was 0 milliseconds ago.<br \/>\n\torg.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)<br \/>\n\torg.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)<br \/>\n\tjavax.servlet.http.HttpServlet.service(HttpServlet.java:621)<br \/>\n\tjavax.servlet.http.HttpServlet.service(HttpServlet.java:722)<\/p>\n<p><\/em><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;Resource auth=&quot;Container1&quot;\r\n          driverClassName=&quot;com.mysql.jdbc.Driver&quot;\r\n          maxActive=&quot;20&quot;\r\n          maxIdle=&quot;10&quot;\r\n          maxWait=&quot;120&quot;\r\n          testWhileIdle=&quot;true&quot;\r\n          validationQuery=&quot;select 1&quot;\r\n          name=&quot;jdbc\/myapp&quot;\r\n          password=&quot;passwd&quot; \r\n          type=&quot;javax.sql.DataSource&quot;\r\n          url=&quot;jdbc:mysql:\/\/127.0.0.1\/mydb?autoReconnect=true&amp;amp;useOldAliasMetadataBehavior=true&quot;\r\n          username=&quot;user&quot;\/&gt;\r\n<\/pre>\n<p>In detail this lines validate connections before use and eliminates closed ones:<\/p>\n<p>          maxActive=&#8221;20&#8243;<br \/>\n          maxIdle=&#8221;10&#8243;<br \/>\n          maxWait=&#8221;120&#8243;<br \/>\n          testWhileIdle=&#8221;true&#8221;<br \/>\n          validationQuery=&#8221;select 1&#8243;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This configuration solve problem with following error: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.dao.RecoverableDataAccessException: PreparedStatementCallback; SQL XXXXXXXXXXXXXXXXXX; Communications link failure The last packet successfully received from the server was 30,184,929 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet &hellip; <a href=\"https:\/\/blog.daghosoft.com\/WP\/solve-problem-with-mysql-closed-pool-by-server\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Solve problem with mysql closed pool by server<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[30],"tags":[52,67,53],"class_list":["post-235","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-connections-pool","tag-mysql","tag-resource"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p77gJg-3N","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/blog.daghosoft.com\/WP\/wp-json\/wp\/v2\/posts\/235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.daghosoft.com\/WP\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.daghosoft.com\/WP\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.daghosoft.com\/WP\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.daghosoft.com\/WP\/wp-json\/wp\/v2\/comments?post=235"}],"version-history":[{"count":7,"href":"https:\/\/blog.daghosoft.com\/WP\/wp-json\/wp\/v2\/posts\/235\/revisions"}],"predecessor-version":[{"id":384,"href":"https:\/\/blog.daghosoft.com\/WP\/wp-json\/wp\/v2\/posts\/235\/revisions\/384"}],"wp:attachment":[{"href":"https:\/\/blog.daghosoft.com\/WP\/wp-json\/wp\/v2\/media?parent=235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.daghosoft.com\/WP\/wp-json\/wp\/v2\/categories?post=235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.daghosoft.com\/WP\/wp-json\/wp\/v2\/tags?post=235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}