• ### Error updating database. Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-02291: 违反完整约束条件 (SSM.SYS_C0011830)


    在向Oracle数据库里面插入数据时发生了以下错误

    ; ]; ORA-02291: 违反完整约束条件 (SSM.SYS_C0011830) - 未找到父项关键字
    ; nested exception is java.sql.SQLIntegrityConstraintViolationException: ORA-02291: 违反完整约束条件 (SSM.SYS_C0011830) - 未找到父项关键字
    
        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:647)
        org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:855)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
        org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
        org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        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)

    A表和B表通过主键与中间表C表关联,在向C表中插入数据时,如果插入C表时中数据没有与A表或者B表中主键对应,就会出现该错误。

    简而言之就是在插入数据时,中间表的数据必须在它所关联的表中存在。

  • 相关阅读:
    最小生成树之 Prim 算法
    Linux通过ps命令找到进程并kill当前进程
    M6G2C Cortex®A7工控核心板SIMCOM4G模块移植流程
    Spring事件监听机制源码解析
    Pytorch损失函数总结
    目标检测任务理解与总结
    [炼丹术]EfficientDet训练模型学习总结
    [炼丹术]DeepLabv3+训练模型学习总结
    可视化经典模型的对比实验总结
    基于COCO数据集验证的目标检测算法天梯排行榜
  • 原文地址:https://www.cnblogs.com/rao11/p/11801257.html
Copyright © 2020-2023  润新知