{"id":702,"date":"2011-05-22T14:30:29","date_gmt":"2011-05-22T13:30:29","guid":{"rendered":"http:\/\/kudzia.eu\/b\/?p=702"},"modified":"2012-01-01T11:36:13","modified_gmt":"2012-01-01T10:36:13","slug":"mysql-connectorj-5-1-16-sphinxql-0-9-9-mysqlnontransientconnectionexception","status":"publish","type":"post","link":"https:\/\/kudzia.eu\/b\/2011\/05\/mysql-connectorj-5-1-16-sphinxql-0-9-9-mysqlnontransientconnectionexception\/","title":{"rendered":"mysql connector\/j 5.1.16 + sphinxql 0.9.9 = MySQLNonTransientConnectionException"},"content":{"rendered":"<p>most recent connector\/j &#8211; 5.1.16 does not seem to work with sphinx search 0.9.9. i did not find [yet] actual cause of the problem but going back to 5.1.15 solved the problem for now.<br \/>\n<!--more--><br \/>\nsometimes it&#8217;s good to refrain from reckless upgrades&#8230; when testing my setup i found that <\/p>\n<p>symptoms:<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nimport java.io.*;\r\nimport java.sql.*;\r\nimport java.util.*;\r\npublic class A{\r\n        public static void main(String&#x5B;] args) throws Exception{\r\n                Class.forName(&quot;com.mysql.jdbc.Driver&quot;).newInstance();\r\n                Connection conn = DriverManager.getConnection(&quot;jdbc:mysql:\/\/host:9306\/data&quot;);\r\n        }\r\n}\r\n<\/pre>\n<p>when run with connector\/j 5.1.15 or older works fine, but with 5.1.16 give me:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nException in thread &quot;main&quot; com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.\r\n        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)\r\n        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)\r\n        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)\r\n        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)\r\n        at com.mysql.jdbc.Util.getInstance(Util.java:386)\r\n        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)\r\n        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)\r\n        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)\r\n        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)\r\n        at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2412)\r\n        at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2154)\r\n        at com.mysql.jdbc.ConnectionImpl.&lt;init&gt;(ConnectionImpl.java:792)\r\n        at com.mysql.jdbc.JDBC4Connection.&lt;init&gt;(JDBC4Connection.java:47)\r\n        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)\r\n        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)\r\n        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)\r\n        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)\r\n        at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381)\r\n        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)\r\n        at java.sql.DriverManager.getConnection(DriverManager.java:582)\r\n        at java.sql.DriverManager.getConnection(DriverManager.java:207)\r\n        at A.main(A.java:9)\r\nCaused by: java.lang.NullPointerException\r\n        at com.mysql.jdbc.ConnectionImpl.isAutoCommitNonDefaultOnServer(ConnectionImpl.java:3619)\r\n        at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3494)\r\n        at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2385)\r\n        ... 13 more\r\n<\/pre>\n<p>most probably this is caused by not-so-good implementation of mysql protocol by sphinx in 0.9.9, but.. it seems i&#8217;ll be stuck with that version of search engine [un]patiently waiting for stable 2.x release. i googled but did not find anything reasonable. <a href=\"http:\/\/www.olegsmith.com\/2010\/12\/scalalift-sphinxql.html\">this<\/a> seems to be close, but adding relaxAutoCommit=false in the connection string did not help. <small>will referencing to probably only reference in the world to my blog post cause some critical exception?<\/small><\/p>\n<p>as a side note &#8211; i&#8217;ve been using sphinx 0.9x-0.99 for over two years in the production environment. it helps me to search over 6M of records &#8211; not a lot in the internet scale but quite nice a number. despite minor hiccups mentioned here &#8211; it works very well. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>most recent connector\/j &#8211; 5.1.16 does not seem to work with sphinx search 0.9.9. i did not find [yet] actual cause of the problem but going back to 5.1.15 solved the problem for now.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[45,44],"class_list":["post-702","post","type-post","status-publish","format-standard","hentry","category-tech","tag-mysql-connectoirj","tag-sphinx-search"],"_links":{"self":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/702","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/comments?post=702"}],"version-history":[{"count":8,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/702\/revisions"}],"predecessor-version":[{"id":946,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/702\/revisions\/946"}],"wp:attachment":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/media?parent=702"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/categories?post=702"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/tags?post=702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}