title: ORA-02292 Constraint violation - child records found
body: <p>parent entity is consits of many to may relation when ever i deleted the parent Id I give the excetion is ORA-02292 Constraint violation - child records found.</p>
  
  <p>My Entity :</p>
  
  <p>@Entity</p>
  
  <p>@Table(name = "MOBEE_AGENCY")</p>
  
  <p>public class MobeeAgency implements java.io.Serializable {</p>
  
  <pre><code>private static final long serialVersionUID = 1L;
  private Long id;
  
  private Set&lt;MobeeAgent&gt; mobeeAgents = new HashSet&lt;MobeeAgent&gt;(0);
  private Set&lt;MobeeAgcyAccounts&gt; mobeeAgcyAccountses = new HashSet&lt;MobeeAgcyAccounts&gt;(
          0);
  
  private Set&lt;MobeeAgencyRegion&gt; MobeeAgencyRegions = new HashSet&lt;MobeeAgencyRegion&gt;(0);
  
  
  
  
  @Id
  @GeneratedValue(generator = "MOBEE_AGENCY_SEQ")
  @SequenceGenerator(name = "MOBEE_AGENCY_SEQ", sequenceName = "MOBEE_AGENCY_SEQ", allocationSize = 1)
  @Column(name = "ID")
  public Long getId() {
      return this.id;
  }
  
  public void setId(Long id) {
      this.id = id;
  }
  
  
  
  @OneToOne(cascade = { CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.LAZY)
  @JoinColumn(name = "APP_ID")
  public MobeeRegProcess getMobeeRegProcess() {
      return this.mobeeRegProcess;
  }
  
  public void setMobeeRegProcess(MobeeRegProcess mobeeRegProcess) {
      this.mobeeRegProcess = mobeeRegProcess;
  }
  
  
  
  
  
  @OneToMany(cascade = { CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.LAZY, mappedBy = "mobeeAgency")
  public Set&lt;MobeeAgent&gt; getMobeeAgents() {
      return this.mobeeAgents;
  }
  
  public void setMobeeAgents(Set&lt;MobeeAgent&gt; mobeeAgents) {
      this.mobeeAgents = mobeeAgents;
  }
  
  @OneToMany(cascade = { CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.LAZY, mappedBy = "mobeeAgency")
  public Set&lt;MobeeAgcyAccounts&gt; getMobeeAgcyAccountses() {
      return this.mobeeAgcyAccountses;
  }
  
  public void setMobeeAgcyAccountses(
          Set&lt;MobeeAgcyAccounts&gt; mobeeAgcyAccountses) {
      this.mobeeAgcyAccountses = mobeeAgcyAccountses;
  }
  
  @OneToMany(cascade = { CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.LAZY, mappedBy = "mobeeAgency")
  public Set&lt;MobeeAgencyRegion&gt; getMobeeAgencyRegions() {
      return MobeeAgencyRegions;
  }
  
  public void setMobeeAgencyRegions(Set&lt;MobeeAgencyRegion&gt; mobeeAgencyRegions) {
      MobeeAgencyRegions = mobeeAgencyRegions;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Getting Exception Is:</p>
  
  <blockquote>
    <p>13:29:56,226 INFO  [STDOUT] [Mobee]- INFO 2012-07-01 13:29:56,225 []
    MobeeAgencyHome - deleting Records for the Agency 832859 13:29:56,251
    INFO  [STDOUT] [Mobee]- WARN 2012-07-01 13:29:56,251 []
    JDBCExceptionReporter - SQL Error: 2292, SQLState: 23000 13:29:56,251
    INFO  [STDOUT] [Mobee]-ERROR 2012-07-01 13:29:56,251 []
    JDBCExceptionReporter - ORA-02292: integrity constraint
    (KCBUSER.FK6B6B82ABC89B1A0C) violated - child record found
    13:29:56,251 INFO  [STDOUT] [Mobee]- WARN 2012-07-01 13:29:56,251 []
    JDBCExceptionReporter - SQL Error: 2292, SQLState: 23000 13:29:56,251
    INFO  [STDOUT] [Mobee]-ERROR 2012-07-01 13:29:56,251 []
    JDBCExceptionReporter - ORA-02292: integrity constraint
    (KCBUSER.FK6B6B82ABC89B1A0C) violated - child record found
    13:29:56,253 INFO  [STDOUT] [Mobee]-ERROR 2012-07-01 13:29:56,251 []
    AbstractFlushingEventListener - Could not synchronize database state
    with session org.hibernate.exception.ConstraintViolationException:
    Could not execute JDBC batch update   at
    org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
      at
    org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      at
    org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
      at
    org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:92)
      at
    org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87)
      at
    org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:222)
      at
    org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2479)
      at
    org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2697)
      at
    org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:74)
      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)   at
    org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
      at
    org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:146)
      at
    org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
      at
    org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
      at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)  at
    org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:296)
      at
    org.jboss.seam.persistence.EntityManagerProxy.flush(EntityManagerProxy.java:92)
      at org.jboss.seam.framework.EntityHome.update(EntityHome.java:64)   at
    com.manam.mobee.agency.MobeeAgencyHome.update(MobeeAgencyHome.java:2599)
      at
    com.manam.mobee.agency.MobeeAgencyHome.processUserDecision(MobeeAgencyHome.java:2465)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)   at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)   at
    java.lang.reflect.Method.invoke(Unknown Source)   at
    org.jboss.seam.util.Reflections.invoke(Reflections.java:22)   at
    org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
      at
    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      at
    org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
      at
    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      at
    org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
      at
    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      at
    org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:56)
      at
    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      at
    org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
      at org.jboss.seam.util.Work.workInTransaction(Work.java:47)     at
    org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
      at
    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      at
    org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
      at
    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      at
    org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163)
      at
    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      at
    org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      at
    org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
      at
    org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
      at
    com.manam.mobee.agency.MobeeAgencyHome_$$_javassist_seam_15.processUserDecision(MobeeAgencyHome_$$_javassist_seam_15.java)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)   at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)   at
    java.lang.reflect.Method.invoke(Unknown Source)   at
    org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
      at
    org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)
      at
    org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
      at
    org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
      at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)    at
    org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      at
    com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
      at
    javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
      at
    com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
      at javax.faces.component.UICommand.broadcast(UICommand.java:383)    at
    org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)
      at
    org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:324)
      at
    org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:299)
      at
    org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:256)
      at
    org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:469)
      at
    com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
      at
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
      at
    com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)   at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:530)     at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at
    org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
      at
    org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
      at
    org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
      at
    org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
      at org.jboss.seam.web.RewriteFilter.process(RewriteFilter.java:98)
      at org.jboss.seam.web.RewriteFilter.doFilter(RewriteFilter.java:57)
      at
    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
      at
    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at
    org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
      at
    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at
    org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      at
    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      at
    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at
    org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      at
    org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)     at
    org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)    at
    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
      at
    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:
    13:29:56,253 INFO  [STDOUT] 158)  at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      at
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      at
    org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at
    org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      at
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      at java.lang.Thread.run(Unknown Source) Caused by:
    java.sql.BatchUpdateException: ORA-02292: integrity constraint
    (KCBUSER.FK6B6B82ABC89B1A0C) violated - child record found</p>
  </blockquote>