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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -