java.sql.SQLException: ORA-02292: integrity constraint (CONFLUENCE.FKBD74B31676E33274) violated - child record found

Atlassian JIRA | Daniel Heise | 6 years ago
  1. 0

    I want to upgrade my 3.1.1 to 3.5.4. After starting the new system I get the following error while updating the database schema: {code} 2011-05-24 09:11:09,656 INFO [main] [com.atlassian.confluence.lifecycle] contextInitialized Starting Confluence 3.5.4 (build #2156) 2011-05-24 09:11:11,960 INFO [main] [atlassian.plugin.manager.DefaultPluginManager] init Initialising the plugin system 2011-05-24 09:11:12,172 INFO [main] [atlassian.plugin.manager.DefaultPluginManager] init Plugin system started in 0:00:00.210 2011-05-24 09:11:13,601 INFO [main] [springframework.web.context.ContextLoader] initWebApplicationContext Root WebApplicationContext: initialization started 2011-05-24 09:11:16,901 INFO [main] [com.atlassian.confluence.lifecycle] <init> Loading EhCache cache manager 2011-05-24 09:11:39,788 INFO [main] [springframework.web.context.ContextLoader] initWebApplicationContext Root WebApplicationContext: initialization completed in 26177 ms 2011-05-24 09:12:05,140 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized Upgrade failed, application will not start: Schema upgrade task [ com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsUpgradeTask@3e4523d6 ] failed due to : PreparedStatementCallback; SQL [DELETE FROM CONTENT_PERM_SET WHERE id = ?]; ORA-02292: integrity constraint (CONFLUENCE.FKBD74B31676E33274) violated - child record found ; nested exception is java.sql.SQLException: ORA-02292: integrity constraint (CONFLUENCE.FKBD74B31676E33274) violated - child record found com.atlassian.confluence.upgrade.UpgradeException: Schema upgrade task [ com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsUpgradeTask@3e4523d6 ] failed due to : PreparedStatementCallback; SQL [DELETE FROM CONTENT_PERM_SET WHERE id = ?]; ORA-02292: integrity constraint (CONFLUENCE.FKBD74B31676E33274) violated - child record found ; nested exception is java.sql.SQLException: ORA-02292: integrity constraint (CONFLUENCE.FKBD74B31676E33274) violated - child record found at com.atlassian.confluence.upgrade.AbstractUpgradeManager.runSchemaUpgradeTasks(AbstractUpgradeManager.java:292) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgradeSchema(AbstractUpgradeManager.java:235) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:87) at com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager.upgrade(DefaultUpgradeManager.java:139) at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:28) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) at org.apache.catalina.core.StandardService.start(StandardService.java:525) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) {code}

    Atlassian JIRA | 6 years ago | Daniel Heise
    java.sql.SQLException: ORA-02292: integrity constraint (CONFLUENCE.FKBD74B31676E33274) violated - child record found
  2. 0

    I want to upgrade my 3.1.1 to 3.5.4. After starting the new system I get the following error while updating the database schema: {code} 2011-05-24 09:11:09,656 INFO [main] [com.atlassian.confluence.lifecycle] contextInitialized Starting Confluence 3.5.4 (build #2156) 2011-05-24 09:11:11,960 INFO [main] [atlassian.plugin.manager.DefaultPluginManager] init Initialising the plugin system 2011-05-24 09:11:12,172 INFO [main] [atlassian.plugin.manager.DefaultPluginManager] init Plugin system started in 0:00:00.210 2011-05-24 09:11:13,601 INFO [main] [springframework.web.context.ContextLoader] initWebApplicationContext Root WebApplicationContext: initialization started 2011-05-24 09:11:16,901 INFO [main] [com.atlassian.confluence.lifecycle] <init> Loading EhCache cache manager 2011-05-24 09:11:39,788 INFO [main] [springframework.web.context.ContextLoader] initWebApplicationContext Root WebApplicationContext: initialization completed in 26177 ms 2011-05-24 09:12:05,140 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized Upgrade failed, application will not start: Schema upgrade task [ com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsUpgradeTask@3e4523d6 ] failed due to : PreparedStatementCallback; SQL [DELETE FROM CONTENT_PERM_SET WHERE id = ?]; ORA-02292: integrity constraint (CONFLUENCE.FKBD74B31676E33274) violated - child record found ; nested exception is java.sql.SQLException: ORA-02292: integrity constraint (CONFLUENCE.FKBD74B31676E33274) violated - child record found com.atlassian.confluence.upgrade.UpgradeException: Schema upgrade task [ com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsUpgradeTask@3e4523d6 ] failed due to : PreparedStatementCallback; SQL [DELETE FROM CONTENT_PERM_SET WHERE id = ?]; ORA-02292: integrity constraint (CONFLUENCE.FKBD74B31676E33274) violated - child record found ; nested exception is java.sql.SQLException: ORA-02292: integrity constraint (CONFLUENCE.FKBD74B31676E33274) violated - child record found at com.atlassian.confluence.upgrade.AbstractUpgradeManager.runSchemaUpgradeTasks(AbstractUpgradeManager.java:292) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgradeSchema(AbstractUpgradeManager.java:235) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:87) at com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager.upgrade(DefaultUpgradeManager.java:139) at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:28) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) at org.apache.catalina.core.StandardService.start(StandardService.java:525) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) {code}

    Atlassian JIRA | 6 years ago | Daniel Heise
    java.sql.SQLException: ORA-02292: integrity constraint (CONFLUENCE.FKBD74B31676E33274) violated - child record found
  3. 0

    For various reasons {{CONTENT_PERM}} table may contain permission settings for the same content, having different usernames. This is usually caused by having the username changed in an external user directory. This causes no problems during normal operation, only upon XML backup restore or for the newly introduced {{LowerCaseUsernameReferencesUpgradeTask}}, that seemingly converts all usernames in the {{CONTENT_PERM}} table to lowercase. In such scenarios, this will cause the upgrade task to fail on unique constraint violation. *Steps to reproduce* # Synchronize an external user directory with Confluence 5.1.x with uppercase username, make sure to add a restriction on a page # Change the username in the external directory to all lowercase, add the same restriction on the same page again # Upgrade the instance to 5.2.3 *Workaround* Identify the duplicate row by matching the lowercase values of the unique constraint on the {{CONTENT_PERM}} table and delete the record that has the uppercase username/groupname. *Sample error message in Oracle* {noformat} 2013-08-22 11:35:14,886 INFO [main] [confluence.upgrade.upgradetask.LoginInfoDuplicateEntryRemovalUpgradeTask] doUpgrade No duplicate logininfo rows found. No action necessary. 2013-08-22 11:35:15,360 INFO [main] [atlassian.confluence.upgrade.UpgradeTask] doUpgrade Finding rows with mixed case username references in LINKS table 2013-08-22 11:35:16,822 INFO [main] [atlassian.confluence.upgrade.UpgradeTask] doUpgrade Finding rows with mixed case username references in TRACKBACKLINKS table 2013-08-22 11:35:16,830 INFO [main] [atlassian.confluence.upgrade.UpgradeTask] doUpgrade Finding rows with mixed case username references in FOLLOW_CONNECTIONS table 2013-08-22 11:35:16,872 INFO [main] [atlassian.confluence.upgrade.UpgradeTask] doUpgrade Finding rows with mixed case username references in LABEL table 2013-08-22 11:35:16,929 INFO [main] [atlassian.confluence.upgrade.UpgradeTask] doUpgrade Finding rows with mixed case username references in SPACES table 2013-08-22 11:35:16,953 INFO [main] [atlassian.confluence.upgrade.UpgradeTask] doUpgrade Finding rows with mixed case username references in NOTIFICATIONS table 2013-08-22 11:35:17,328 INFO [main] [atlassian.confluence.upgrade.UpgradeTask] doUpgrade Finding rows with mixed case username references in CONTENT_PERM table 2013-08-22 11:35:17,734 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized Upgrade failed, application will not start: Upgrade task com.atlassian.confluence.upgrade.upgradetask.LowerCaseUsernameReferencesUpgradeTask@5913b1de failed during the SCHEMA_UPGRADE phase due to: PreparedStatementCallback; SQL [update CONTENT_PERM set USERNAME = ?, CREATOR = ?, LASTMODIFIER = ? where ID = ?]; ORA-00001: unique constraint (WIKI32.CP_UNIQUE_USER_GROUPS) violated ; nested exception is java.sql.SQLException: ORA-00001: unique constraint (WIKI32.CP_UNIQUE_USER_GROUPS) violated com.atlassian.confluence.upgrade.UpgradeException: Upgrade task com.atlassian.confluence.upgrade.upgradetask.LowerCaseUsernameReferencesUpgradeTask@5913b1de failed during the SCHEMA_UPGRADE phase due to: PreparedStatementCallback; SQL [update CONTENT_PERM set USERNAME = ?, CREATOR = ?, LASTMODIFIER = ? where ID = ?]; ORA-00001: unique constraint (WIKI32.CP_UNIQUE_USER_GROUPS) violated ; nested exception is java.sql.SQLException: ORA-00001: unique constraint (WIKI32.CP_UNIQUE_USER_GROUPS) violated at com.atlassian.confluence.upgrade.AbstractUpgradeManager.executeUpgradeStep(AbstractUpgradeManager.java:268) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.runSchemaUpgradeTasks(AbstractUpgradeManager.java:193) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:143) at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:50) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) at org.apache.catalina.core.StandardService.start(StandardService.java:525) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) 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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [update CONTENT_PERM set USERNAME = ?, CREATOR = ?, LASTMODIFIER = ? where ID = ?]; ORA-00001: unique constraint (WIKI32.CP_UNIQUE_USER_GROUPS) violated ; nested exception is java.sql.SQLException: ORA-00001: unique constraint (WIKI32.CP_UNIQUE_USER_GROUPS) violated at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:228) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:607) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:619) at org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:866) at com.atlassian.confluence.upgrade.upgradetask.LowerCaseUsernameReferencesUpgradeTask.updateRows(LowerCaseUsernameReferencesUpgradeTask.java:85) at com.atlassian.confluence.upgrade.upgradetask.LowerCaseUsernameReferencesUpgradeTask.doUpgrade(LowerCaseUsernameReferencesUpgradeTask.java:71) 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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy20.doUpgrade(Unknown Source) at com.atlassian.confluence.upgrade.AbstractUpgradeManager$UpgradeStep$3.execute(AbstractUpgradeManager.java:662) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.executeUpgradeStep(AbstractUpgradeManager.java:244) ... 18 more Caused by: java.sql.SQLException: ORA-00001: unique constraint (WIKI32.CP_UNIQUE_USER_GROUPS) violated at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395) at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:205) at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1008) at oracle.jdbc.driver.OraclePreparedStatement.executeForRowsWithTimeout(OraclePreparedStatement.java:9855) at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:9959) at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:213) at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297) at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297) at org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:881) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:591) ... 35 more 2013-08-22 11:35:17,744 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized 1 errors were encountered during upgrade: 2013-08-22 11:35:17,759 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized 1: PreparedStatementCallback; SQL [update CONTENT_PERM set USERNAME = ?, CREATOR = ?, LASTMODIFIER = ? where ID = ?]; ORA-00001: unique constraint (WIKI32.CP_UNIQUE_USER_GROUPS) violated ; nested exception is java.sql.SQLException: ORA-00001: unique constraint (WIKI32.CP_UNIQUE_USER_GROUPS) violated{noformat}

    Atlassian JIRA | 3 years ago | Peter Koczan
    java.sql.SQLException: ORA-00001: unique constraint (WIKI32.CP_UNIQUE_USER_GROUPS) violated
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I have both many-to-many and one-to-many mappings in my project. When I delete the entities, the deletion isn't cascaded accordingly. Thus, dependent objects aren't deleted from the database (either the 'many' side of the one-to-many, or the entries in the join table for the many-to-many). Example mapping (one-to-many): Booking -> BookingNight. HQL: delete from Booking Error: 19/04/2005 13:57:03 org.hibernate.hql.ast.QueryTranslatorImpl parse FINE: parse() - HQL: delete from com.wotif.jaguar.domain.booking.Booking 19/04/2005 13:57:03 org.hibernate.hql.ast.QueryTranslatorImpl showHqlAst FINE: --- HQL AST --- \-[DELETE] 'delete' \-[FROM] 'implied-from-so-i-can-use-the-fromClause-rule-during-analysis-phase' \-[DOT] '.' +-[DOT] '.' | +-[DOT] '.' | | +-[DOT] '.' | | | +-[DOT] '.' | | | | +-[IDENT] 'com' | | | | \-[IDENT] 'wotif' | | | \-[IDENT] 'jaguar' | | \-[IDENT] 'domain' | \-[IDENT] 'booking' \-[IDENT] 'Booking' 19/04/2005 13:57:03 org.hibernate.hql.ast.ErrorCounter throwQueryException FINE: throwQueryException() : no errors 19/04/2005 13:57:03 org.hibernate.hql.ast.FromElement doInitialize FINE: FromClause{level=1} : com.wotif.jaguar.domain.booking.Booking (no alias) -> booking0_ 19/04/2005 13:57:03 org.hibernate.hql.ast.QueryTranslatorImpl analyze FINE: --- SQL AST --- \-[DELETE] QueryNode: 'delete' querySpaces (ORDER_INVOICE) \-[FROM] FromClause: 'implied-from-so-i-can-use-the-fromClause-rule-during-analysis-phase' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[], fromElementByTableAlias=[booking0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]} \-[FROM_FRAGMENT] FromElement: 'ORDER_INVOICE' FromElement{explicit,not a collection join,classAlias=null,role=null,tableName=ORDER_INVOICE,tableAlias=booking0_,colums={,className=com.wotif.jaguar.domain.booking.Booking}} 19/04/2005 13:57:03 org.hibernate.hql.ast.ErrorCounter throwQueryException FINE: throwQueryException() : no errors 19/04/2005 13:57:03 org.hibernate.hql.ast.QueryTranslatorImpl generate FINE: HQL: delete from com.wotif.jaguar.domain.booking.Booking 19/04/2005 13:57:03 org.hibernate.hql.ast.QueryTranslatorImpl generate FINE: SQL: delete from ORDER_INVOICE 19/04/2005 13:57:03 org.hibernate.hql.ast.ErrorCounter throwQueryException FINE: throwQueryException() : no errors 19/04/2005 13:57:03 org.hibernate.jdbc.AbstractBatcher logOpenPreparedStatement FINE: about to open PreparedStatement (open PreparedStatements: 0, globally: 0) 19/04/2005 13:57:03 org.hibernate.jdbc.AbstractBatcher log FINE: delete from ORDER_INVOICE 19/04/2005 13:57:03 org.hibernate.jdbc.AbstractBatcher logClosePreparedStatement FINE: about to close PreparedStatement (open PreparedStatements: 1, globally: 1) 19/04/2005 13:57:03 org.hibernate.util.JDBCExceptionReporter logExceptions FINE: could not execute update query [delete from ORDER_INVOICE] java.sql.SQLException: ORA-02292: integrity constraint (RWATKINS.OIAN_ORDER_INVOICE_ID_FK) violated - child record found at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181) at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:543) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1028) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2960) at org.hibernate.hql.ast.UpdateStatementExecutor.execute(UpdateStatementExecutor.java:67) at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:292) at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:815) at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:89) at com.wotif.jaguar.util.HibernateTestUtil.deleteAll(HibernateTestUtil.java:307) at com.wotif.jaguar.util.HibernateTestUtil.deleteAll(HibernateTestUtil.java:251) at com.wotif.jaguar.hibernate.HibernateConfigTest.testDeleteAll(HibernateConfigTest.java:160) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.textui.TestRunner.doRun(TestRunner.java:116) at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57) at junit.textui.TestRunner.start(TestRunner.java:172) at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23) at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:97) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) 19/04/2005 13:57:03 org.hibernate.util.JDBCExceptionReporter logExceptions WARNING: SQL Error: 2292, SQLState: 23000 19/04/2005 13:57:03 org.hibernate.util.JDBCExceptionReporter logExceptions SEVERE: ORA-02292: integrity constraint (RWATKINS.OIAN_ORDER_INVOICE_ID_FK) violated - child record found ---- Example mapping (many-to-many): RoomType <--> RoomFacility HQL: delete from RoomType Error: 19/04/2005 14:16:40 org.hibernate.hql.ast.QueryTranslatorImpl parse FINE: parse() - HQL: delete from com.wotif.jaguar.domain.property.RoomType 19/04/2005 14:16:40 org.hibernate.hql.ast.QueryTranslatorImpl showHqlAst FINE: --- HQL AST --- \-[DELETE] 'delete' \-[FROM] 'implied-from-so-i-can-use-the-fromClause-rule-during-analysis-phase' \-[DOT] '.' +-[DOT] '.' | +-[DOT] '.' | | +-[DOT] '.' | | | +-[DOT] '.' | | | | +-[IDENT] 'com' | | | | \-[IDENT] 'wotif' | | | \-[IDENT] 'jaguar' | | \-[IDENT] 'domain' | \-[IDENT] 'property' \-[IDENT] 'RoomType' 19/04/2005 14:16:40 org.hibernate.hql.ast.ErrorCounter throwQueryException FINE: throwQueryException() : no errors 19/04/2005 14:16:40 org.hibernate.hql.ast.FromElement doInitialize FINE: FromClause{level=1} : com.wotif.jaguar.domain.property.RoomType (no alias) -> roomtype0_ 19/04/2005 14:16:40 org.hibernate.hql.ast.QueryTranslatorImpl analyze FINE: --- SQL AST --- \-[DELETE] QueryNode: 'delete' querySpaces (PROP_MASTER_ROOM_TYPE) \-[FROM] FromClause: 'implied-from-so-i-can-use-the-fromClause-rule-during-analysis-phase' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[], fromElementByTableAlias=[roomtype0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]} \-[FROM_FRAGMENT] FromElement: 'PROP_MASTER_ROOM_TYPE' FromElement{explicit,not a collection join,classAlias=null,role=null,tableName=PROP_MASTER_ROOM_TYPE,tableAlias=roomtype0_,colums={,className=com.wotif.jaguar.domain.property.RoomType}} 19/04/2005 14:16:40 org.hibernate.hql.ast.ErrorCounter throwQueryException FINE: throwQueryException() : no errors 19/04/2005 14:16:40 org.hibernate.hql.ast.QueryTranslatorImpl generate FINE: HQL: delete from com.wotif.jaguar.domain.property.RoomType 19/04/2005 14:16:40 org.hibernate.hql.ast.QueryTranslatorImpl generate FINE: SQL: delete from PROP_MASTER_ROOM_TYPE 19/04/2005 14:16:40 org.hibernate.hql.ast.ErrorCounter throwQueryException FINE: throwQueryException() : no errors 19/04/2005 14:16:40 org.hibernate.jdbc.AbstractBatcher logOpenPreparedStatement FINE: about to open PreparedStatement (open PreparedStatements: 0, globally: 0) 19/04/2005 14:16:40 org.hibernate.jdbc.AbstractBatcher log FINE: delete from PROP_MASTER_ROOM_TYPE 19/04/2005 14:16:40 org.hibernate.jdbc.AbstractBatcher logClosePreparedStatement FINE: about to close PreparedStatement (open PreparedStatements: 1, globally: 1) 19/04/2005 14:16:40 org.hibernate.util.JDBCExceptionReporter logExceptions FINE: could not execute update query [delete from PROP_MASTER_ROOM_TYPE] java.sql.SQLException: ORA-02292: integrity constraint (RWATKINS.PMRTF_PROP_ROOM_TYPE_ID_FK) violated - child record found at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181) at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:543) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1028) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2960) at org.hibernate.hql.ast.UpdateStatementExecutor.execute(UpdateStatementExecutor.java:67) at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:292) at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:815) at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:89) ... Obvious workaround would be to use deletion cascade in the database, but this worked in Hibernate 2.1.6 without those triggers.

    Hibernate JIRA | 1 decade ago | Robert Watkins
    java.sql.SQLException: ORA-02292: integrity constraint (RWATKINS.PMRTF_PROP_ROOM_TYPE_ID_FK) violated - child record found
  6. 0

    I have both many-to-many and one-to-many mappings in my project. When I delete the entities, the deletion isn't cascaded accordingly. Thus, dependent objects aren't deleted from the database (either the 'many' side of the one-to-many, or the entries in the join table for the many-to-many). Example mapping (one-to-many): Booking -> BookingNight. HQL: delete from Booking Error: 19/04/2005 13:57:03 org.hibernate.hql.ast.QueryTranslatorImpl parse FINE: parse() - HQL: delete from com.wotif.jaguar.domain.booking.Booking 19/04/2005 13:57:03 org.hibernate.hql.ast.QueryTranslatorImpl showHqlAst FINE: --- HQL AST --- \-[DELETE] 'delete' \-[FROM] 'implied-from-so-i-can-use-the-fromClause-rule-during-analysis-phase' \-[DOT] '.' +-[DOT] '.' | +-[DOT] '.' | | +-[DOT] '.' | | | +-[DOT] '.' | | | | +-[IDENT] 'com' | | | | \-[IDENT] 'wotif' | | | \-[IDENT] 'jaguar' | | \-[IDENT] 'domain' | \-[IDENT] 'booking' \-[IDENT] 'Booking' 19/04/2005 13:57:03 org.hibernate.hql.ast.ErrorCounter throwQueryException FINE: throwQueryException() : no errors 19/04/2005 13:57:03 org.hibernate.hql.ast.FromElement doInitialize FINE: FromClause{level=1} : com.wotif.jaguar.domain.booking.Booking (no alias) -> booking0_ 19/04/2005 13:57:03 org.hibernate.hql.ast.QueryTranslatorImpl analyze FINE: --- SQL AST --- \-[DELETE] QueryNode: 'delete' querySpaces (ORDER_INVOICE) \-[FROM] FromClause: 'implied-from-so-i-can-use-the-fromClause-rule-during-analysis-phase' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[], fromElementByTableAlias=[booking0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]} \-[FROM_FRAGMENT] FromElement: 'ORDER_INVOICE' FromElement{explicit,not a collection join,classAlias=null,role=null,tableName=ORDER_INVOICE,tableAlias=booking0_,colums={,className=com.wotif.jaguar.domain.booking.Booking}} 19/04/2005 13:57:03 org.hibernate.hql.ast.ErrorCounter throwQueryException FINE: throwQueryException() : no errors 19/04/2005 13:57:03 org.hibernate.hql.ast.QueryTranslatorImpl generate FINE: HQL: delete from com.wotif.jaguar.domain.booking.Booking 19/04/2005 13:57:03 org.hibernate.hql.ast.QueryTranslatorImpl generate FINE: SQL: delete from ORDER_INVOICE 19/04/2005 13:57:03 org.hibernate.hql.ast.ErrorCounter throwQueryException FINE: throwQueryException() : no errors 19/04/2005 13:57:03 org.hibernate.jdbc.AbstractBatcher logOpenPreparedStatement FINE: about to open PreparedStatement (open PreparedStatements: 0, globally: 0) 19/04/2005 13:57:03 org.hibernate.jdbc.AbstractBatcher log FINE: delete from ORDER_INVOICE 19/04/2005 13:57:03 org.hibernate.jdbc.AbstractBatcher logClosePreparedStatement FINE: about to close PreparedStatement (open PreparedStatements: 1, globally: 1) 19/04/2005 13:57:03 org.hibernate.util.JDBCExceptionReporter logExceptions FINE: could not execute update query [delete from ORDER_INVOICE] java.sql.SQLException: ORA-02292: integrity constraint (RWATKINS.OIAN_ORDER_INVOICE_ID_FK) violated - child record found at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181) at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:543) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1028) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2960) at org.hibernate.hql.ast.UpdateStatementExecutor.execute(UpdateStatementExecutor.java:67) at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:292) at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:815) at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:89) at com.wotif.jaguar.util.HibernateTestUtil.deleteAll(HibernateTestUtil.java:307) at com.wotif.jaguar.util.HibernateTestUtil.deleteAll(HibernateTestUtil.java:251) at com.wotif.jaguar.hibernate.HibernateConfigTest.testDeleteAll(HibernateConfigTest.java:160) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.textui.TestRunner.doRun(TestRunner.java:116) at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57) at junit.textui.TestRunner.start(TestRunner.java:172) at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23) at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:97) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) 19/04/2005 13:57:03 org.hibernate.util.JDBCExceptionReporter logExceptions WARNING: SQL Error: 2292, SQLState: 23000 19/04/2005 13:57:03 org.hibernate.util.JDBCExceptionReporter logExceptions SEVERE: ORA-02292: integrity constraint (RWATKINS.OIAN_ORDER_INVOICE_ID_FK) violated - child record found ---- Example mapping (many-to-many): RoomType <--> RoomFacility HQL: delete from RoomType Error: 19/04/2005 14:16:40 org.hibernate.hql.ast.QueryTranslatorImpl parse FINE: parse() - HQL: delete from com.wotif.jaguar.domain.property.RoomType 19/04/2005 14:16:40 org.hibernate.hql.ast.QueryTranslatorImpl showHqlAst FINE: --- HQL AST --- \-[DELETE] 'delete' \-[FROM] 'implied-from-so-i-can-use-the-fromClause-rule-during-analysis-phase' \-[DOT] '.' +-[DOT] '.' | +-[DOT] '.' | | +-[DOT] '.' | | | +-[DOT] '.' | | | | +-[IDENT] 'com' | | | | \-[IDENT] 'wotif' | | | \-[IDENT] 'jaguar' | | \-[IDENT] 'domain' | \-[IDENT] 'property' \-[IDENT] 'RoomType' 19/04/2005 14:16:40 org.hibernate.hql.ast.ErrorCounter throwQueryException FINE: throwQueryException() : no errors 19/04/2005 14:16:40 org.hibernate.hql.ast.FromElement doInitialize FINE: FromClause{level=1} : com.wotif.jaguar.domain.property.RoomType (no alias) -> roomtype0_ 19/04/2005 14:16:40 org.hibernate.hql.ast.QueryTranslatorImpl analyze FINE: --- SQL AST --- \-[DELETE] QueryNode: 'delete' querySpaces (PROP_MASTER_ROOM_TYPE) \-[FROM] FromClause: 'implied-from-so-i-can-use-the-fromClause-rule-during-analysis-phase' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[], fromElementByTableAlias=[roomtype0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]} \-[FROM_FRAGMENT] FromElement: 'PROP_MASTER_ROOM_TYPE' FromElement{explicit,not a collection join,classAlias=null,role=null,tableName=PROP_MASTER_ROOM_TYPE,tableAlias=roomtype0_,colums={,className=com.wotif.jaguar.domain.property.RoomType}} 19/04/2005 14:16:40 org.hibernate.hql.ast.ErrorCounter throwQueryException FINE: throwQueryException() : no errors 19/04/2005 14:16:40 org.hibernate.hql.ast.QueryTranslatorImpl generate FINE: HQL: delete from com.wotif.jaguar.domain.property.RoomType 19/04/2005 14:16:40 org.hibernate.hql.ast.QueryTranslatorImpl generate FINE: SQL: delete from PROP_MASTER_ROOM_TYPE 19/04/2005 14:16:40 org.hibernate.hql.ast.ErrorCounter throwQueryException FINE: throwQueryException() : no errors 19/04/2005 14:16:40 org.hibernate.jdbc.AbstractBatcher logOpenPreparedStatement FINE: about to open PreparedStatement (open PreparedStatements: 0, globally: 0) 19/04/2005 14:16:40 org.hibernate.jdbc.AbstractBatcher log FINE: delete from PROP_MASTER_ROOM_TYPE 19/04/2005 14:16:40 org.hibernate.jdbc.AbstractBatcher logClosePreparedStatement FINE: about to close PreparedStatement (open PreparedStatements: 1, globally: 1) 19/04/2005 14:16:40 org.hibernate.util.JDBCExceptionReporter logExceptions FINE: could not execute update query [delete from PROP_MASTER_ROOM_TYPE] java.sql.SQLException: ORA-02292: integrity constraint (RWATKINS.PMRTF_PROP_ROOM_TYPE_ID_FK) violated - child record found at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181) at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:543) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1028) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2960) at org.hibernate.hql.ast.UpdateStatementExecutor.execute(UpdateStatementExecutor.java:67) at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:292) at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:815) at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:89) ... Obvious workaround would be to use deletion cascade in the database, but this worked in Hibernate 2.1.6 without those triggers.

    Hibernate JIRA | 1 decade ago | Robert Watkins
    java.sql.SQLException: ORA-02292: integrity constraint (RWATKINS.PMRTF_PROP_ROOM_TYPE_ID_FK) violated - child record found

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.sql.SQLException

      ORA-02292: integrity constraint (CONFLUENCE.FKBD74B31676E33274) violated - child record found

      at com.atlassian.confluence.upgrade.AbstractUpgradeManager.runSchemaUpgradeTasks()
    2. com.atlassian.confluence
      UpgradeLauncherServletContextListener.contextInitialized
      1. com.atlassian.confluence.upgrade.AbstractUpgradeManager.runSchemaUpgradeTasks(AbstractUpgradeManager.java:292)
      2. com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgradeSchema(AbstractUpgradeManager.java:235)
      3. com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:87)
      4. com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager.upgrade(DefaultUpgradeManager.java:139)
      5. com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:28)
      5 frames
    3. Glassfish Core
      Catalina.start
      1. org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
      2. org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
      3. org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      4. org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
      5. org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      6. org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
      7. org.apache.catalina.core.StandardService.start(StandardService.java:525)
      8. org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
      9. org.apache.catalina.startup.Catalina.start(Catalina.java:595)
      9 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    5. Glassfish Core
      Bootstrap.main
      1. org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      2. org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      2 frames