codesearch-github/codesearch — Issue #32: mysql session variables should be configurable and be set by codesearch on session start
Author: marmichael
Created: 2012-02-24 15:57:12+00:00
State: open
Labels: New Feature

while indexing large java files it may happen that this error message will be logged:

15:25:13,058 DEBUG IndexingTask:415 - Added file: NBIServicePortStub.java to index.
15:25:13,063 DEBUG IndexingTask:326 - Analyzing file: opennet/trunk/ngm-commons/src/main/java-generated/alcatel/cpe/management/NBIServicePortStub.java
15:25:13,392 ERROR IndexingTask:212 - Code analyzing failed: Database error:org.codesearch.commons.database.DatabaseAccessException: SQLException while trying to access the database com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1860436 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.

this variable can be set in the mysql configuration file my.conf for the whole server or the client can add the parameter sessionVariables=max_allowed_packet=16M to the connection properties.

i would prefer connection parameter as my.conf settings are for all running mysql databases.

max_allowed_packet:
http://dev.mysql.com/doc/refman/5.1/de/dynamic-system-variables.html

sessionVariables for mysql Connector/J
http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html