MYSQL mediumText大字段存储错误问题排查「建议收藏」

MYSQL mediumText大字段存储错误问题排查「建议收藏」思路:1:由于日志查询问题,没看到日志之前怀疑:MYSQL数据库字段长度是否真的足够,排查问题未果。2:步骤一未果,看日志了解错误信息如下Name”:”com.javartisan.audience_management.jsf_service.service.AudienceService”}org.springframework.orm.jpa.JpaSystemExcepti…

大家好,又见面了,我是你们的朋友全栈君。

思路:

1:由于日志查询问题,没看到日志之前怀疑:MYSQL数据库字段长度是否真的足够,排查问题未果。

2:步骤一未果,看日志了解错误信息如下

Name":"com.javartisan.audience_management.jsf_service.service.AudienceService"}
org.springframework.orm.jpa.JpaSystemException: could not execute statement; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement
	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:351)
	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:253)
	at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:536)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:746)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:714)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:533)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:304)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
	at com.javartisan.audience_management.service.impl.AudienceDefinitionService$$EnhancerBySpringCGLIB$$85ea7805.createAudienceDef(<generated>)
	at com.javartisan.audience_management.service.impl.AudienceServiceImpl.createAudience(AudienceServiceImpl.java:305)
	at com.javartisan.audience_management.service.impl.AudienceServiceImpl$$FastClassBySpringCGLIB$$4e489ed8.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684)
	at com.javartisan.audience_management.service.impl.AudienceServiceImpl$$EnhancerBySpringCGLIB$$b5e8045e.createAudience(<generated>)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.javartisan.jsf.gd.filter.ProviderInvokeFilter.reflectInvoke(ProviderInvokeFilter.java:140)
	at com.javartisan.jsf.gd.filter.ProviderInvokeFilter.invoke(ProviderInvokeFilter.java:100)
	at com.javartisan.common.spring.interceptor.JsfLogMessageInterceptor.invoke(JsfLogMessageInterceptor.java:28)
	at com.javartisan.audience_management.filter.AuthFilter.invoke(AuthFilter.java:70)
	at com.javartisan.common.spring.interceptor.JsfMdcInterceptor.invoke(JsfMdcInterceptor.java:29)
	at com.javartisan.jsf.gd.filter.ProviderConcurrentsFilter.invoke(ProviderConcurrentsFilter.java:62)
	at com.javartisan.jsf.gd.filter.ProviderTimeoutFilter.invoke(ProviderTimeoutFilter.java:39)
	at com.javartisan.jsf.gd.filter.ProviderMethodCheckFilter.invoke(ProviderMethodCheckFilter.java:78)
	at com.javartisan.jsf.gd.filter.ProviderInvokeLimitFilter.invoke(ProviderInvokeLimitFilter.java:54)
	at com.javartisan.jsf.gd.filter.ProviderHttpGWFilter.invoke(ProviderHttpGWFilter.java:47)
	at com.javartisan.jsf.gd.filter.ProviderGenericFilter.invoke(ProviderGenericFilter.java:118)
	at com.javartisan.jsf.gd.filter.ProviderContextFilter.invoke(ProviderContextFilter.java:73)
	at com.javartisan.jsf.gd.filter.ExceptionFilter.invoke(ExceptionFilter.java:49)
	at com.javartisan.jsf.gd.filter.SystemTimeCheckFilter.invoke(SystemTimeCheckFilter.java:79)
	at com.javartisan.jsf.gd.filter.FilterChain.invoke(FilterChain.java:275)
	at com.javartisan.jsf.gd.server.ProviderProxyInvoker.invoke(ProviderProxyInvoker.java:67)
	at com.javartisan.jsf.gd.server.JSFTask.doRun(JSFTask.java:123)
	at com.javartisan.jsf.gd.server.BaseTask.run(BaseTask.java:27)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.hibernate.exception.GenericJDBCException: could not execute statement
	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:178)
	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3174)
	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3688)
	at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:90)
	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:604)
	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:478)
	at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:356)
	at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)
	at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1453)
	at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:510)
	at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3282)
	at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2478)
	at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:473)
	at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:178)
	at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$300(JdbcResourceLocalTransactionCoordinatorImpl.java:39)
	at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:271)
	at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:104)
	at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:532)
	... 40 common frames omitted
Caused by: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (11379664 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.
	at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3681)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2512)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
	at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)
	at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)
	at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)
	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)
	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:175)
	... 57 common frames omitted

 

解决方案:设置参数max_allowed_packet 更大满足需求

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/146248.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • softreference 回收_reference stacks

    softreference 回收_reference stacksSoftReference和WeakReferenceJava和Android内存优化的两个类:SoftReference和WeakReferencePostedon2010-10-2200:55charley_yang阅读(436)评论(0)编辑收藏  如果你想写一个Java程序,观察某对象什么时候会被垃圾收集的执行绪清除,你必须要用一个re

  • 网络爬虫原理

    目录1网络爬虫原理2写网络爬虫的原因3网络爬虫的流程4网络抓包5HTTP状态码说明6Java网络爬虫需要的基础知识1、网络爬虫原理网络爬虫指按照一定的规则(模拟人工登录网页的方式),自动抓取网络上的程序。简单的说,就是讲你上网所看到页面上的内容获取下来,并进行存储。网络爬虫的爬行策略分为深度优先和广度优先。如下图是深度优先的一种遍历方式是A到B到D到E到C

  • 【前端】HTML底部返回顶部悬浮按钮

    【前端】HTML底部返回顶部悬浮按钮CSS样式:.back-to{ bottom:55px; overflow:hidden; position:fixed; right:10px; width:110px; z-index:999; } .back-to.back-top{ background:url(“./imag…

  • Java集合List去重的几种方式「建议收藏」

    Java集合List去重的几种方式「建议收藏」1、使用LinkedHashSet删除arraylist中的重复数据LinkedHashSet是在一个ArrayList删除重复数据的最佳方法。LinkedHashSet在内部完成两件事: 删除重复数据 保持添加到其中的数据的顺序 Java示例使用LinkedHashSet删除arraylist中的重复项。在给定的示例中,numbersList是包含整数的arraylist,其中一些是重复的数字。例如1,3和5.我们将列表添加到LinkedHashSet,然后将内容返回到列表中。

  • 博弈论三个枪手的故事_博弈模型的三个基本要素

    博弈论三个枪手的故事_博弈模型的三个基本要素彼此痛恨的甲、乙、丙三个枪手准备决斗。甲枪法最好,十发八中;乙枪法次之,十发六中;丙枪法最差,十发四中。先提第一个问题:如果三人同时开枪,并且每人只发一枪;第一轮枪战后,谁活下来的机会大一些?一般人认为甲的枪法好,活下来的可能性大一些。但合乎推理的结论是,枪法最糟糕的丙活下来的几率最大。我们来分析一下各个枪手的策略。枪手甲一定要对枪手乙先开枪。因为乙对甲的威胁要比丙对甲的威胁更大,甲应该首…

    2022年10月15日
  • threadid=1: thread exiting with uncaught except…

    threadid=1: thread exiting with uncaught except…

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号