Saturday, 15 August 2015

jdbc - Setting MySql Session Variables -



jdbc - Setting MySql Session Variables -

we noticed of queries running in our spring/java environment coming truncated columns. problem group_concat_max_len set small. tried modifying our database definition .sql file include set session:

drop database if exists acmedb; create database acmedb; utilize acmedb; set session group_concat_max_len = 6999; create table...

however not going effect after db reload. have jdbctemplate execute() statement code propogate. while fixes problem wondering if can tell me why executing via sql script not anything.

edit in effort prepare problem tried dropping next line in our dao init() method:

this.jdbctemplateobject.execute("set session group_concat_max_len = 6999 ");

this fixes problem... sometimes. think session expires , alter lost. rules on mysql set session in terms of longevity of call? set statement before every query executed seems lot of unnecessary overhead.

mysql jdbc

No comments:

Post a Comment