解决报错问题:SQLIntegrityConstraintViolationExcepti。。。

更新时间:2023-05-25 08:47:02 阅读: 评论:0

考研政治大纲
解决报错问题:SQLIntegrityConstraintViolationExcepti 。。。verifycode
解决报错问题:SQLIntegrityConstraintViolationException: Duplicate entry ‘4’ for key ‘PRIMARY’to be forgotten
SqlSession [org.apache.ibatis.ssion.defaults.DefaultSqlSession@4813a18a] was not registered for synchronization becau synchronization is not active
JDBC Connection [sql.cj.jdbc.ConnectionImpl@703e71fd] will not be managed by Spring
==> Preparing: INSERT INTO wx_main_detail ( home_id, sort_order, create_time ) values ( ?, ?, ? )
==> Parameters: 3(Integer), 1(Integer), 2019-11-27 10:51:58.805(Timestamp)
Closing non transactional SqlSession [org.apache.ibatis.ssion.defaults.DefaultSqlSession@4813a18a]
2019-11-27 10:51:58.865 ERROR 119624 — [ XNIO-1 task-29] c.GlobalExceptionHandler : 异常信息uri=/sys/WxMainHome/saveEditIn,method=POST,e={}
org.springframework.dao.DuplicateKeyException:时代周刊谈2020年
兴奋用英语怎么说
翻译繁体字
Error updating databa. Cau: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry ‘4’ for key ‘PRIMARY’
The error may involve com.ultrapower.life.mapper.WxMainDetailMapper.inrtId-Inline
The error occurred while tting parameters
SQL: INSERT INTO wx_main_detail ( home_id, sort_order, create_time ) values ( ?, ?, ? )
Cau: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry ‘4’ for key ‘PRIMARY’; Duplicate entry ‘4’ for key ‘PRIMARY’; nested exception is java.sql.SQLIntegrityConstraintViolationException:Duplicate entry ‘4’ for key ‘PRIMARY’
at
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslat or.java:242)
at
英文名字翻译
org.springframework.jdbc.anslate(AbstractFallbackSQLExceptionTransla tor.java:72)
batis.anslateExceptionIfPossible(MyBatisExceptionTranslator.java:73)batis.spring.SqlSessionTemplate Proxy101.inrt(Unknown Source)
batis.spring.SqlSessionTemplate.inrt(SqlSessionTemplate.java:278)
wander
看报错信息,“Duplicate entry ‘4’ for key ‘PRIMARY’”表⽰,主键有重复的,因此,错误的原因就是值重复了,解决此类问题就是将插⼊的值不能是数据库已经有了的主键,在我这个项⽬中主要是把表的id 设置为不是⾃动递增(去掉勾选)
SqlSessionInterceptor .invoke (SqlSessionTemplate .java :
446)atcom .sun .proxy .
在我的插⼊语句的mapper⽂件⾥插⼊需要的id即可:
twice怎么读后⾯我的项⽬就跑起来了peephole

本文发布于:2023-05-25 08:47:02,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/78/769071.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

上一篇:克罗地亚签证
标签:翻译   问题   解决
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图