title: dbunit disable Oracle constraint
body: <p>I'm using DbUnit 2.4.8 with Oracle 10g and JUnit 4.5.  I'd like to disable the foreign key constraints in Oracle while running the DbUnit tests I have so I can test single tables independent of all other tables.   This is what I have so far:  </p>
  
  <p>I have created a class (DBUnitHelper) which extends DatabaseTestCase.  I've </p>
  
  <pre><code>@Override
  protected IDatabaseConnection getConnection() throws Exception {
  
      if (usingInternalCtx_)
      {
          if (!esa.util.SysConfig.isRunning())
              esa.util.SysConfig.startupSystem();
  
          ctx_ = OraPool.getCtx();
      }
  
      //disable foreign keys
      Connection con = ctx_.getConnection();
      con.prepareStatement("SET CONSTRAINTS ALL DEFERRED").execute();
  
      return new OracleConnection(con, "my_schema");  // DatabaseConnection(con_);
  }
  </code></pre>
  
  <p>The JUnit test method is:</p>
  
  <pre><code>@Test
  public void useDatabaseTesterToRemoveExistingDataThenRunTest()
  {
      IDataSet dataset = null;
  
      try
      {
          IDatabaseTester databaseTester = dbunit_.getDatabaseTester();
          databaseTester.setDataSet(dbunit_.getDataSet());
          databaseTester.onSetup();   // clean out existing entries in the table specified by the dataset and populate it with entries from the database
  
          IDataSet databaseDataSet = databaseTester.getDataSet();
          // IDataSet databaseDataSet = con.createDataSet();  // uncomment to retrieve actual rows from the database
          ITable actualTable = databaseDataSet.getTable(TABLE_NAME);
  
          // Load expected data from an XML dataset
          IDataSet expectedDataSet = dbunit_.getDataSet();
          ITable expectedTable = expectedDataSet.getTable(TABLE_NAME);
  
          // Assert new testing database table match expected (xml) table
          assertEquals(3,expectedTable.getRowCount());
          assertEquals(expectedTable.getRowCount(), actualTable.getRowCount());
          assertEquals(expectedTable.getValue(1, "oid"), actualTable.getValue(1, "oid"));
          Assertion.assertEquals(expectedTable, actualTable);
  
          databaseTester.onTearDown();  // by default does nothing
      } catch (Exception e)
      {
          e.printStackTrace();
          fail("test_names has problems");
      }
  }
  </code></pre>
  
  <p>I get an <code>ORA-02291:  integrity constraint violated - parent key not found error</code> on the Junit line:  <code>databaseTester.onSetup();</code>.  When I step through this with the debugger, I see that the <code>DBUnitHelper.getConnection()</code> is never being called.  </p>
  
  <p>Any ideas on what I need to fix to disable the constraints in Oracle?</p>