Spring SimpleJDBCInsert : insert query getting blocked when the column value extends the column length -


when try insert record in table using simplejdbcinsert , make value of column greater column length, query not execute, without throwing exception, , blocking further code-flow.
when check mysql fullprocesslist, after code reaches insert statmemt, database on query fired, shows in sleep

i rectified issue truncating column value schema's column length in application.

sample code example:

public class blogdaoimpl implements blogdao {       private simplejdbctemplate simplejdbctemplate;       private simplejdbcinsert insertblog;        public void setdatasource(datasource datasource) {           this.simplejdbctemplate = new simplejdbctemplate(datasource);           this.insertblog =                    new simplejdbcinsert(datasource)                    .withtablename("blog");                    .usinggeneratedkeycolumns("id");       }        public void create(string name, integer age, long salary) {           map parameters = new hashmap();           parameters.put("city_id", "vancouver");           parameters.put("blogger", "bay max");            number id = insertemp.executeandreturnkey(parameters);       }     }   

in case if city_id length in mysql database varchar(2), code gets blocked @ number line id = insertemp.executeandreturnkey(parameters);

would interested know, should spring not throw jdbc exception of
data truncation: data long column or other exception.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -