What is the longevity of a "SET SESSION" statement?
Posted by: Dakota Roberts
Date: November 24, 2014 10:18AM

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.

Options: ReplyQuote


Subject
Written By
Posted
What is the longevity of a "SET SESSION" statement?
November 24, 2014 10:18AM


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.