Intermittent MySQLSyntaxErrorException: Unknown column - JDBC/Tomcat
Posted by: Bryan Kramer
Date: November 04, 2012 05:14PM

This is a Tomcat/JDBC mysql problem.

I am not using a resource or JNDI since the HTTP requests supply a database URL and credentials. The connection is made on every request to the servlet.

The environment is mysql (mysql Ver 14.12 Distrib 5.0.95, for redhat-linux-gnu (x86_64) on a different host, java 1.6.0_22 (OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode) CentOS 64 Bit, Tomcat 5.5 (also Tomcat 6), mysql-connector java 5.1.22. max_packet length is 10GB.

The result of the query contains about 400 columns when it works.

The problem is that some really long queries (~ 12,000 characters in the select statement) I get the syntax error exception for a while - after some time it starts correctly working again. All of the time, shorter queries work during the time when the long queries are not working. As a matter of fact I threw in a "show tables" before the big query - this always works correctly.

It sometimes seems to have to do with how active Tomcat is - this problem occurs when Tomcat has been idle a while. Unfortunately this servlet will not be heavily used in production so I need to solve this problem.

Any suggestions for fixes would be greatly appreciated.

Thanks

Options: ReplyQuote


Subject
Written By
Posted
Intermittent MySQLSyntaxErrorException: Unknown column - JDBC/Tomcat
November 04, 2012 05:14PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.