违反唯一约束条件_违反唯一条件约束 - CSDN
精华内容
参与话题
  • 最近在做项目是测试的时候出现了这种错误:ORA-00001: 违反唯一约束条件 其实说白了这种错误就是 数据库的ID值,小于他的next number 由于表的ID是唯一的,所以用 select max(id) from test 查的该ID大于Sequences...

    最近在做项目是测试的时候出现了这种错误:ORA-00001: 违反唯一约束条件
    其实说白了这种错误就是 数据库的ID值,小于他的next number 由于表的ID是唯一的,所以用 select max(id) from test 查的该ID大于Sequences里面的开始ID,所以出现了该情况
    在这里插入图片描述
    在这里插入图片描述
    为此,我们只要更改Sequences(plsql数据库里查找对应文件夹下有没有该ID,没有创建一个)里面的”开始于“的 ID 大于 max(ID) 即可。问题解决!

    展开全文
  • Caused by: java.sql.BatchUpdateException:ORA-00001: 违反唯一约束条件 (SOLEX.SYS_C0012537) 2、分析 ①(SOLEX.SYS_C0012537)是我们在数据库设置的约束条件的name,一般是主键ID约束 ②同hbm.xml文件找到主键...

    1、错误
    Caused by: java.sql.BatchUpdateException:ORA-00001: 违反唯一约束条件 (SOLEX.SYS_C0012537)
    2、分析
    ①通过SYS_C0012537找到对应的表
    select a.constraint_name,a.constraint_type,b.column_name,b.table_name
    from user_constraints a inner join user_cons_columns b on a.table_name=b.table_name
    where a.constraint_name=‘SYS_C0012537’
    ②同hbm.xml文件找到主键的自增序列名称

    SEQ_FEEPAY_COST_D

    ③到数据库序列sequences查找该序列名称:SEQ_FEEPAY_COST_D,然后修改下一个ID的值
    这里写图片描述

    展开全文
  • Oracle数据库新增时—违反唯一约束条件 原因 sequence冲突 解决 于数据库中,先进行sequence的自增 HTTP Status 500 – Internal Server Error Type Exception Report Message Request processing failed;...

    问题
    Oracle数据库新增时—违反唯一约束条件
    原因
    sequence冲突
    解决
    于数据库中,先进行sequence的自增

    HTTP Status 500 – Internal Server Error
    
    Type Exception Report
    
    Message Request processing failed; nested exception is org.springframework.dao.DuplicateKeyException:
    
    Description The server encountered an unexpected condition that prevented it from fulfilling the request.
    
    Exception
    
    org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.dao.DuplicateKeyException: 
    ### Error updating database.  Cause: java.sql.SQLException: ORA-00001: 违反唯一约束条件 (CC.SYS_C005489)
    
    ### The error may exist in com/itheima/dao/RoleDao.java (best guess)
    ### The error may involve com.itheima.dao.RoleDao.save-Inline
    ### The error occurred while setting parameters
    ### SQL: insert into sys_role values(?,?,?)
    ### Cause: java.sql.SQLException: ORA-00001: 违反唯一约束条件 (CC.SYS_C005489)
    
    ; ]; ORA-00001: 违反唯一约束条件 (CC.SYS_C005489)
    ; nested exception is java.sql.SQLException: ORA-00001: 违反唯一约束条件 (CC.SYS_C005489)
    
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:986)
    	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:881)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:855)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)
    	org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
    	org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158)
    	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
    	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
    	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)
    	org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
    	org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
    	org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
    	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
    	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    
    Root Cause
    
    org.springframework.dao.DuplicateKeyException: 
    ### Error updating database.  Cause: java.sql.SQLException: ORA-00001: 违反唯一约束条件 (CC.SYS_C005489)
    
    ### The error may exist in com/itheima/dao/RoleDao.java (best guess)
    ### The error may involve com.itheima.dao.RoleDao.save-Inline
    ### The error occurred while setting parameters
    ### SQL: insert into sys_role values(?,?,?)
    ### Cause: java.sql.SQLException: ORA-00001: 违反唯一约束条件 (CC.SYS_C005489)
    
    ; ]; ORA-00001: 违反唯一约束条件 (CC.SYS_C005489)
    ; nested exception is java.sql.SQLException: ORA-00001: 违反唯一约束条件 (CC.SYS_C005489)
    
    	org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:243)
    	org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
    	org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75)
    	org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:447)
    	com.sun.proxy.$Proxy104.insert(Unknown Source)
    	org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:279)
    	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:57)
    	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
    	com.sun.proxy.$Proxy119.save(Unknown Source)
    	com.itheima.service.impl.RoleServiceImpl.save(RoleServiceImpl.java:24)
    	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	java.lang.reflect.Method.invoke(Method.java:498)
    	org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:338)
    	org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
    	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    	org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
    	org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
    	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    	org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
    	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    	org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
    	com.sun.proxy.$Proxy120.save(Unknown Source)
    	com.itheima.controller.RoleController.save(RoleController.java:29)
    	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	java.lang.reflect.Method.invoke(Method.java:498)
    	org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)
    	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
    	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
    	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:871)
    	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:777)
    	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
    	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
    	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
    	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:881)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:855)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)
    	org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
    	org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158)
    	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
    	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
    	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)
    	org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
    	org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
    	org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
    	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
    	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    
    Root Cause
    
    java.sql.SQLException: ORA-00001: 违反唯一约束条件 (CC.SYS_C005489)
    
    	oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    	oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
    	oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
    	oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
    	oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:213)
    	oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:952)
    	oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1160)
    	oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
    	oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3390)
    	com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.execute(NewProxyPreparedStatement.java:989)
    	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	java.lang.reflect.Method.invoke(Method.java:498)
    	org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
    	com.sun.proxy.$Proxy49.execute(Unknown Source)
    	org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:46)
    	org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
    	org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
    	org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
    	org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
    	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	java.lang.reflect.Method.invoke(Method.java:498)
    	org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
    	com.sun.proxy.$Proxy128.update(Unknown Source)
    	org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198)
    	org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185)
    	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	java.lang.reflect.Method.invoke(Method.java:498)
    	org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:434)
    	com.sun.proxy.$Proxy104.insert(Unknown Source)
    	org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:279)
    	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:57)
    	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
    	com.sun.proxy.$Proxy119.save(Unknown Source)
    	com.itheima.service.impl.RoleServiceImpl.save(RoleServiceImpl.java:24)
    	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	java.lang.reflect.Method.invoke(Method.java:498)
    	org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:338)
    	org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
    	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    	org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
    	org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
    	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    	org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
    	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    	org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
    	com.sun.proxy.$Proxy120.save(Unknown Source)
    	com.itheima.controller.RoleController.save(RoleController.java:29)
    	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	java.lang.reflect.Method.invoke(Method.java:498)
    	org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)
    	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
    	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
    	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:871)
    	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:777)
    	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
    	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
    	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
    	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:881)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:855)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)
    	org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
    	org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158)
    	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
    	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
    	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
    	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    	org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)
    	org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
    	org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
    	org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
    	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
    	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    
    Note The full stack trace of the root cause is available in the server logs.
    Apache Tomcat/8.5.28
    
    展开全文
  • oracle插入数据报ORA-00001:违反唯一约束条件

    参考:http://blog.csdn.net/burongwawa520/article/details/50848625

    就是新插入记录的主键跟已经存在记录的主键一样,所以导致冲突,可以把新插入的记录的主键打印出来看一下是否已经存在,如果已经存在并且是自增id的话,可以使用sql:select SEQ_DICT_ID.nextval as summaryId from dual 一直增加id,使id增加到是新的id为止,这样子就不会报错了。

    就是会有疑问,竟然id是自增的,那么id会一直自增,那为什么会和原来的id冲突了呢?是不是并发产生了这样的问题

    展开全文
  • 违反唯一约束条件

    千次阅读 2012-09-18 17:41:04
    对象类型(索引还是约束) select object_type from user_objects where...查看某表的约束条件 select constraint_name, constraint_type,search_condition, r_constraint_name from user_constraints where table_na
  • oracle数据库,pl/sql工具,最近在用update语句批量更新时,发现更新报错,提示"违反唯一约束条件",如何找到更新出错的数据呢?此处做个记录: update语句为: update wmwhse2.lotattribute t1 set t1.lottable02=...
  • Caused by: java.sql.BatchUpdateException:ORA-00001: 违反唯一约束条件 (SOLEX.SYS_C0012537) 2、分析 ①通过SYS_C0012537找到对应的表 select a.constraint_name,a.constraint_type,b.column_name,b.table_name ...
  • SQL错误:违反唯一约束条件

    千次阅读 2019-07-10 19:47:37
    java.sql.BatchUpdateException: ORA-00001: 违反唯一约束条件 (AML.PK_LTB_INS_RPOL) at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:12296) at oracle.jdbc.driver....
  • 违反唯一条件约束

    2020-03-13 10:08:31
    今天遇到了一个问题,违反唯一条件约束,根据后台报错信息找到库.表,然后根据对应插入的数据(一般是根据对应表中主键插入)查找是否有这条数据,有的话说明这条数据已经存在,然后可以删除这条数据,在做一次数据...
  • 今天使用PL/SQL对表进行数据插入,插入的方法是: 1. select max(pkid) from TBOP_01MATERIAL;//得出pkid为139018 2. 查看表TBOP_01MATERIAL的表结构,仅pkid为主键 3. 让pkid为139019,插入一条新记录,提示...
  •  明明只有一个主键约束啊 编辑一下: 然后得到一个表: 实在没辙,就选中了重建表: 然后发现还是报同样的错。。。 大部分网上给的这类错误都是insert而不是update,不知道我理解错在了哪里 如果说按照...
  • 首先要明确的是在插入数据时报这个错误,证明表真的是存在对检查的数据有不唯一的存在。 但是在你检查你的主键并用做group by XXX having count(*)>1 ,这个检查时你会发现没有重复的数据,这就头大了。 在pl/sql ...
  • Oracle:ORA-00001 违反唯一约束条件

    万次阅读 2014-07-05 10:49:00
    1、 DROP SEQUENCE a_fault_info_SEQ;  2、create sequence a_fault_info_SEQ  minvalue 1000  maxvalue 999999999999999999999999999  start with 1  increment by 1  cache
  • ORA-00001 违反唯一约束条件

    万次阅读 2010-11-10 10:05:00
    (果然是序列产生的最小值设置的太小,将序列值设置大之后,问题解决)原文如下:  对于java.sql.SQLException: ORA-00001:违反唯一约束条件,可能是该表的主键唯一性出错,即:主键中已有某个键值,现在又要插入...
  • ORA-00001: 违反唯一约束条件

    万次阅读 2017-06-20 09:45:21
    ORA-00001: 违反唯一约束条件
  • ORA-0001违反唯一约束条件

    千次阅读 2018-09-14 14:52:30
    报错  修改方法  1.查询sys_users_log最大系列号,如76336 2.修改输入最大序列号为76337即可  
  • Caused by: java.sql.BatchUpdateException:ORA-00001: 违反唯一约束条件 (SOLEX.SYS_C0012537) 2、分析 ①通过SYS_C0012537找到对应的表 select a.constraint_name,a.constraint_type,b.column_name,b.table_name ...
  • 数据表的主键唯一,约束条件中的开始值小于数据表的最大记录数值,主键ID冲突,所以出现“ORA-00001: 违反唯一约束条件” 1. 查询表中最大记录数值 select max(to_number(主键ID)) from 表名 2. 修改约束条件的开始...
  • 数据库违反唯一约束错误

    千次阅读 2018-01-03 14:42:47
    org.springframework.dao.DuplicateKeyException:  ... Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: 违反唯一约束条件 (HISTEST.idx_treatment_card_no)找到那个字段违反约束条
  • 今天,在自己初出茅庐做项目时遇到急需处理情况,那就是在多人同时提交数据时,插入ID时,报错:违反唯一约束条件。我之前处理ID方法是采用ID+1 查询 再插入的方法,这种情况配合事务时就会报错。解决方法,采用序列...
1 2 3 4 5 ... 20
收藏数 13,588
精华内容 5,435
关键字:

违反唯一约束条件