ORA-02266: unique/primary keys in table referenced by enabled foreign keys

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ORA-02266: unique/primary keys in table referenced by enabled foreign keys

lester lobo
This post has NOT been accepted by the mailing list yet.
Hi All,

Getting the following exception while executing JUnit Tests on Jenkins. We use DBUnit in our testing framework to setup test data.

java.sql.SQLSyntaxErrorException: ORA-02266: unique/primary keys in table referenced by enabled foreign keys

This issue is occuring adhocly. The data setup is correct, not sure what the root cause is.

There seems to be some bug with DBUnit cleaning up data from tables that have foreign key association.

Exception thrown is as follows;

java.sql.SQLSyntaxErrorException: ORA-02266: unique/primary keys in table referenced by enabled foreign keys

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
        at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1033)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
        at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1909)
        at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1871)
        at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:318)
        at org.dbunit.database.statement.SimpleStatement.executeBatch(SimpleStatement.java:69)
        at org.dbunit.operation.DeleteAllOperation.execute(DeleteAllOperation.java:126)
        at org.dbunit.operation.TruncateTableOperation.execute(TruncateTableOperation.java:84)
        at com.dpwn.newops.bootstrap.AbstractIntegrationTest.doOperation(AbstractIntegrationTest.java:130)
        at com.dpwn.newops.bootstrap.AbstractIntegrationTest.onSetUpInTransaction(AbstractIntegrationTest.java:90)
        at org.springframework.test.AbstractTransactionalSpringContextTests.onSetUp(AbstractTransactionalSpringContextTests.java:203)
        at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:104)
        at junit.framework.TestCase.runBare(TestCase.java:132)