我是靠谱客的博主 感动月饼,最近开发中收集的这篇文章主要介绍Duplicate entry ‘‘ for key ‘index_***‘,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

Caused by: java.sql.BatchUpdateException: Duplicate entry '' for key 'index_code'
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
	at com.mysql.cj.util.Util.handleNewInstance(Util.java:192)
	at com.mysql.cj.util.Util.getInstance(Util.java:167)
	at com.mysql.cj.util.Util.getInstance(Util.java:174)
	at com.mysql.cj.jdbc.exceptions.SQLError.createBatchUpdateException(SQLError.java:224)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchSerially(ClientPreparedStatement.java:853)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:435)
	at com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:796)
	at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeBatch(DruidPooledPreparedStatement.java:565)
	at io.seata.rm.datasource.StatementProxy.lambda$executeBatch$9(StatementProxy.java:129)
	at io.seata.rm.datasource.exec.ExecuteTemplate.execute(ExecuteTemplate.java:73)
	at io.seata.rm.datasource.exec.ExecuteTemplate.execute(ExecuteTemplate.java:51)
	at io.seata.rm.datasource.StatementProxy.executeBatch(StatementProxy.java:129)
	at com.baomidou.mybatisplus.core.executor.MybatisBatchExecutor.doFlushStatements(MybatisBatchExecutor.java:133)
	at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:129)
	at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:122)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.flushStatements(DefaultSqlSession.java:252)
	at com.baomidou.mybatisplus.extension.service.impl.ServiceImpl.lambda$executeBatch$3(ServiceImpl.java:258)
	at com.baomidou.mybatisplus.extension.service.impl.ServiceImpl.executeBatch(ServiceImpl.java:222)

以我这个为准
就是因为加了个唯一索引code

最后

以上就是感动月饼为你收集整理的Duplicate entry ‘‘ for key ‘index_***‘的全部内容,希望文章能够帮你解决Duplicate entry ‘‘ for key ‘index_***‘所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(46)

评论列表共有 0 条评论

立即
投稿
返回
顶部