hibernate-关于clob插入mysql报如下错误

问题描述

关于clob插入mysql报如下错误

org.springframework.jdbc.UncategorizedSQLException: Hibernate flushing: could not update: [com.zte.ace.po.ApplicationAce#162304]; uncategorized SQLException for SQL [update application_ace set userId=?, usingName=?, version=?, description=?, packageName=?, usingType=?, iconPath=?, siconPath=?, appPath=?, state=?, creater=?, provider=?, CPId=?, createTime=?, checker=?, checkDate=?, updater=?, updateTime=?, fileSize=?, downloadCount=?, supportDevice=?, detail=?, discussCount=?, isAce=?, orderNo=?, refuseContent=?, codePath=?, versionCode=?, isAd=?, recommend=?, os=?, bigClassId=?, del=?, drafts=?, typeId=?, releaseState=?, appImgs=?, ratyNum=?, raty=?, appGuid=?, resolution=?, appType=?, userType=?, publishDate=?, iconType=?, isFullScreen=?, templateId=?, sourcePath=?, sourceFile=?, isEbook=?, ebooklogotype=?, ebookicontype=?, ebookbgtype=?, sbgPath=?, bgPath=?, isCharge=?, price=?, chapter=?, ebookAdv=?, ebookAdvId=?, author=?, copyId=?, admsg=?, chargeid=?, chargekey=?, paycode=?, shotImg=?, umAppKey=?, sourceNum=?, baiduAdv=?, baiduAppsid=?, baiduAppsec=?, srcPrice=?, virDownloadCount=?, MMCharge=?, UniCharge=?, Charge360=?, uniVacName=?, uniVacCode=?, AppPath360=?, UniAppPath=?, vigilantlevel=?, readable=?, useChSearchDirectory=?, isgetscore=?, appStatus=?, hasRdZtehr=?, isWellNo=?, startCover=?, teleCharge=?, telePayID=?, telePaySecret=?, telePayCode=?, teleAppPath=? where id=?]; SQL state [null]; error code [0]; Invalid position in BLOB object set; nested exception is javax.sql.rowset.serial.SerialException: Invalid position in BLOB object set
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.orm.hibernate3.HibernateTransactionManager.convertJdbcAccessException(HibernateTransactionManager.java:801)
at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:787)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:663)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy29.updateAppsObj(Unknown Source)
at com.zte.ace.comic.action.ComicAction.rebuildComic(ComicAction.java:711)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:891)
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1293)
at ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68)
at com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:117)
at com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:108)
at ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1369)
at ognl.ASTMethod.getValueBody(ASTMethod.java:90)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
at ognl.SimpleNode.getValue(SimpleNode.java:258)
at ognl.Ognl.getValue(Ognl.java:494)
at ognl.Ognl.getValue(Ognl.java:458)
at com.opensymphony.xwork2.ognl.OgnlUtil$2.execute(OgnlUtil.java:309)
at com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecute(OgnlUtil.java:340)
at com.opensymphony.xwork2.ognl.OgnlUtil.getValue(OgnlUtil.java:307)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:423)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:287)
at com.zte.ace.interceptor.AutoLoginInter.intercept(AutoLoginInter.java:83)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
Caused by: javax.sql.rowset.serial.SerialException: Invalid position in BLOB object set
at javax.sql.rowset.serial.SerialClob.getSubString(SerialClob.java:255)
at com.mysql.jdbc.PreparedStatement.setClob(PreparedStatement.java:3529)
at org.apache.commons.dbcp.DelegatingPreparedStatement.setClob(DelegatingPreparedStatement.java:183)
at org.hibernate.type.ClobType.set(ClobType.java:73)
at org.hibernate.type.ClobType.nullSafeSet(ClobType.java:141)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2015)

解决方案

已解决,不过还是不知道什么原因

解决方案二:

看不懂。
看下是不是Blob blob = new SerialBlob();如果不是换这个试下

解决方案三:

是无效的Blob对象集的引用导致的。你需要序列化存储的对象,才能用于海伯内特的存储机制。希望能帮到你

解决方案四:

它的意思是你把null添加到某个字段里面,但你在数据库的表里面设计了这个字段不能添加null,通过代码看好像是Blob为空的原因,但你可以先断点,获取这条sql,再直接在客户端里面运行,看看那个字段报错,再到代码里面重点检查这个错误。

时间: 2024-10-09 16:40:48

hibernate-关于clob插入mysql报如下错误的相关文章

mybatis多线程批量插入MySQL报主键冲突

问题描述 mybatis多线程批量插入MySQL报主键冲突 insert into SMS_DOWN_HISTORY(templateCode,activityCode,activityId,sendRoundId,arrangeDate,expireDate,messageId,mobile,requestId,senderId,depName,depId,flag,level,smsTemplateVar,systemName,mtime,ctime) values (#{item.temp

python 中文插入mysql报错

问题描述 python 中文插入mysql报错 哪位大神帮忙看看这个是什么问题? python 中文插入mysql报错: content= [1165630L, '13940546367', 361L, None, Decimal('449.00'), Decimal('0.00'), 'xd5xd4xd4xa8xd5', 'xc1xc9xc4xfexcaxa1', 'xc9xf2xd1xf4xcaxd0', 'xbaxcdxc6xbdxc7xf8', 'xb6xfexbbxb7xd2xd4xc

tomcat-关于hibernate的问题,一个项目刚导入时可以运行,但在果断时间后再次运行就报500错误

问题描述 关于hibernate的问题,一个项目刚导入时可以运行,但在果断时间后再次运行就报500错误 具体情况介绍,在某网站下载了一份开源代码之后,第一次导入Eclipse,是可以运行的.但在一段时间之后,再次运行报500错误.期间没有对代码有过任何修改.删除该项目重新解压一份并导入后又可以运行,但过段时间后又不能运行.感觉这个问题很奇怪,有没有大神懂.下面我说一下今天的情况:下午又导入了一次,运行时没问题的,然后我停掉tomcat后,紧接着又运行了一遍,还是可以的.之后我就不再运行这个项目.

mysql-请问往MYSQL里导入一个SQL表,为什么会报这个错误?

问题描述 请问往MYSQL里导入一个SQL表,为什么会报这个错误? 开始导入----------> 然后就提示--------> 文件路径: 我选择的路径没错额:D:源代码下载存储day7-mysql多表资料与作业EMPDEPT.sql 信息日志如下: [Err] 1051 - Unknown table 'dept' [Err] -- ---------------------------- -- Table structure for DEPT DROP TABLE DEPT; CREAT

用hibernate做页面注册报这样错误 could not insert: [com.sxt.po.User]

问题描述 用hibernate做页面注册报这样错误 could not insert: [com.sxt.po.User] org.hibernate.exception.SQLGrammarException: could not insert: [com.sxt.po.User] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90) at org.hibernate.exception.

mysql报General error 2006 MySQL server has gone away...错误解决方法

一个定时脚本select表的时候频繁报错,具体错误如:...... General error: 2006 MySQL server has gone away. The SQL statement executed was: SELECT * FROM ......,检查了一下发现是由于这是一个循环里面的select查询,而两次select的查询间隔超过了数据库定义的wait_timeout时长,即mysql长连接很久没有新的请求发起,达到了server端的wait_timeout的值后,被s

[新手上路]为什么同样一个sql文件 导入mysql毫无问题但是导入sql2005各种报语法错误

问题描述 [新手上路]为什么同样一个sql文件 导入mysql毫无问题但是导入sql2005各种报语法错误 DROP TABLE IF EXISTS messages; CREATE TABLE messages (id int(11) NOT NULL AUTO_INCREMENT,saver varchar(255) DEFAULT NULL,savetime varchar(255) DEFAULT NULL,content varchar(255) DEFAULT NULL,recont

mybatis-JAVA,Mybatis插入报断言错误

问题描述 JAVA,Mybatis插入报断言错误 FAILED: insertCoinPresentRecord java.lang.AssertionError at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setObject(SQLServerPreparedStatement.java:981) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.set

4442型卡故障-新制的4442型IC卡,插入读卡机报器 "校验码错误" 怎么处理?

问题描述 新制的4442型IC卡,插入读卡机报器 "校验码错误" 怎么处理? 使用的洗衣店的4442型卡,总公司给发的IC卡不够用,公司说自己做也可以.但我新做了些洗衣店的4442型IC卡,插入读卡机报器报 "校验码错误",打电话问总部,他们说没有加密,让问制卡厂家,可制卡厂家说IC出厂都是空白的.请问这是什么原理,怎么处理才能正常使用.