1、问题描述
在提交数据的时候,发现如下问题
org.springframework.dao.TransientDataAccessResourceException:
Error updating database. Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (144900 > 1024). You can change this value on the server by setting the max_allowed_packet’ variable.
The error may involve dwz.persistence.mapper.DownJobMapper.bachInsert-Inline
The error occurred while setting parameters
Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (144900 > 1024). You can change this value on the server by setting the max_allowed_packet’ variable.
; SQL []; Packet for query is too large (144900 > 1024). You can change this value on the server by setting the max_allowed_packet’ variable.; nested exception is com.mysql.jdbc.PacketTooBigException: Packet for query is too large (144900 > 1024). You can change this value on the server by setting the max_allowed_packet’ variable.
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:107)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:71)
at org.mybatis.spring.SqlSessionTemplateSqlSessionInterceptor.invoke(SqlSessionTemplate.java:346)atcom.sun.proxy.Proxy8.insert(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:231)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:56)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:38)
at com.sun.proxy.$Proxy27.bachInsert(Unknown Source)
at dwz.business.job.impl.DownJobServiceMgrImpl.bachInsert(DownJobServiceMgrImpl.java:63)
2、检查问题
在检查my.inf的配置的时候,发现这个是正常的,已经把值得非常大。