Hibernate: could not execute native bulk manipulation query

Viewed 71944

I got this error when trying to update data using native SQL. This is my script:

update weight_note_receipt set pledge_id =:pledge  where wn_id in (:wns)

wns is the string that contains more than 1 wn_id like this:

222,226,228,251,256,262,263,264,265,266,267,272,281,286,294,296,299,301,302,303,306,307,330,332,333,337,338,339,341,368,371,376,377,378,379,380,381,385,391,397,423,424,443,452,454,461,462,463,464,490,503,504,521,525,528,529,530,532,533,549,554,560,561,564,565,566,567,569,570,595,598,600,603,605,606,607,644,646,649,653,661,662,663,667,669,678,683,752,1039,1075,258,259,260,261,268,269,270,287,304,305,308,325,334,604,643,647,648,659,660,664,665,666,704,709,753,754,757,758,809,834,846,861,872,879,882,911,913,916,919,920,164

When I update (using query.executeUpdate()), it throws the following error:

Request processing failed; nested exception is org.hibernate.exception.DataException: could not execute native bulk manipulation query] with root cause com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: '222,226,228,251,256,262,263,264,265,266,267,272,281,286,294,296,299,301,302,303,306,307,330,332,333,337,338,339,341,368,371,376,'

Is it because the input string is too long?

3 Answers

If client is sending a data which size is more than the size specified in the database , then it throws org.hibernate.exception.GenericJDBCException: could not execute native bulk manipulation query at org.hibernate.exception.SQLStateConverter.handledNonSpecificException..

Related