We noticed that some of the queries we were running in our spring/java environment were coming back with truncated text after 1024 characters. The problem was group_concat_max_len was set too small. I tried modifying our database definition .sql file to include SET SESSION:
DROP DATABASE IF EXISTS acmedb;
CREATE DATABASE acmedb;
USE acmedb;
SET SESSION group_concat_max_len = 6999;
CREATE TABLE...
However this is not going into effect after a db reload. I have to do a jdbctemplate execute() statement with this code for it to propogate.
this.jdbcTemplateObject.execute("SET SESSION group_concat_max_len = 6999 ");
This fixes the problem... sometimes. I think eventually the session expires and this change is lost. What are the rules on mysql set session in terms of longevity of the call? I could put this statement before every query is executed but that seems like a lot of unnecessary overhead.
DROP DATABASE IF EXISTS acmedb;
CREATE DATABASE acmedb;
USE acmedb;
SET SESSION group_concat_max_len = 6999;
CREATE TABLE...
However this is not going into effect after a db reload. I have to do a jdbctemplate execute() statement with this code for it to propogate.
this.jdbcTemplateObject.execute("SET SESSION group_concat_max_len = 6999 ");
This fixes the problem... sometimes. I think eventually the session expires and this change is lost. What are the rules on mysql set session in terms of longevity of the call? I could put this statement before every query is executed but that seems like a lot of unnecessary overhead.