title: JdbcSQLException: Referential integrity constraint violation [on delete]
body: <p>I am setting up unit tests on my application, and that for I need to mockup the database so I am not altering the actual one.</p>
  
  <p>So, I am using <strong>DBUnit</strong> to simulate a database based on a <strong>XML File</strong> :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;dataset&gt;
      &lt;ACTION_TYPE ID="1" NAME="INVALID_CPT"/&gt;
      &lt;ACTION_TYPE ID="2" NAME="INTEGRATED_FLOW"/&gt;
      &lt;ACTION_TYPE ID="3" NAME="CLOSING_TECHNICAL_FLOW"/&gt;
      &lt;ACTION_TYPE ID="4" NAME="AUDIT_FLOW"/&gt;
      &lt;ACTION_TYPE ID="5" NAME="VALIDATION_FLOW"/&gt;
      &lt;ACTION_TYPE ID="6" NAME="RETURN_DRAFT_FLOW"/&gt;
  
      &lt;USER_GROUP ID="1" NAME="AKA_CPT"/&gt;
      &lt;USER_GROUP ID="2" NAME="AKA_ADMIN_SECU"/&gt;
      &lt;USER_GROUP ID="3" NAME="AKA_CISO"/&gt;
      &lt;USER_GROUP ID="4" NAME="AKA_ADMIN_NETWORK"/&gt;
  
      &lt;ACTION_USER_GROUP ACTION_TYPE_ID="1" USER_GROUP_ID="1"/&gt;
      &lt;ACTION_USER_GROUP ACTION_TYPE_ID="4" USER_GROUP_ID="1"/&gt;
      &lt;ACTION_USER_GROUP ACTION_TYPE_ID="6" USER_GROUP_ID="1"/&gt;
      &lt;ACTION_USER_GROUP ACTION_TYPE_ID="2" USER_GROUP_ID="2"/&gt;
      &lt;ACTION_USER_GROUP ACTION_TYPE_ID="3" USER_GROUP_ID="2"/&gt;
      &lt;ACTION_USER_GROUP ACTION_TYPE_ID="5" USER_GROUP_ID="2"/&gt;
      &lt;ACTION_USER_GROUP ACTION_TYPE_ID="5" USER_GROUP_ID="3"/&gt;
      &lt;ACTION_USER_GROUP ACTION_TYPE_ID="2" USER_GROUP_ID="4"/&gt;
  &lt;/dataset&gt;
  </code></pre>
  
  <p>This is just a part of the whole XML file, but this is where my problem come from.</p>
  
  <p>I have these 2 objects <strong>ACTION_TYPE</strong> and <strong>USER_GROUP</strong> which are linked by a Many to Many relationship.</p>
  
  <p>But as soon as I run my test code, I am getting this error:</p>
  
  <pre><code>org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "FKFA9ACTE184RNO1RS40IW6E1LK: PUBLIC.ACTION FOREIGN KEY(USER_GROUP_ID) REFERENCES PUBLIC.USER_GROUP(ID) (2)"; SQL statement:
  delete from USER_GROUP [23503-193]
  </code></pre>
  
  <p>I know what an integrity constraint violation is, but despite I do not think I made one in the XML file above.</p>
  
  <p>Does someone know where this error is coming from, and maybe how I could fix it?</p>
  
  <p>Thank you in advance</p>