I’m using a prepared statement + execute batch in order to insert data into my database and getting this error message:
java.sql.BatchUpdateException: Packet for query is too large (1908435 > 1048576). You can change this value on the server by setting the max_allowed_packet’ variable.
My question is if this error occur because on row inside the batch was too large or because the whole batch was too large.
If I will reduce the number of rows in a batch, will it make a difference? Or does this message indicates that one row inside my batch is too large.
Thanks
Daniel
I would assume your row is not 1908435 bytes long so it would have to be the batch size in total. If your rows were smaller you could have the same number of rows, but I would assume it easier to reduce the number of rows in your batch, or do what it suggests which is to increase the limit.