<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Dbunit on technocracy</title><link>https://www.ericsimmerman.com/tags/dbunit/</link><description>Recent content in Dbunit on technocracy</description><generator>Hugo</generator><language>en</language><lastBuildDate>Wed, 17 Jun 2009 00:00:00 +0000</lastBuildDate><atom:link href="https://www.ericsimmerman.com/tags/dbunit/index.xml" rel="self" type="application/rss+xml"/><item><title>Resolve foreign key constraint error/conflict with DBUnit CLEAN_INSERT operation (MySQLIntegrityConstraintViolationException)</title><link>https://www.ericsimmerman.com/blog/2009/06/17/resolve-foreign-key-constraint-error/conflict-with-dbunit-clean_insert-operation-mysqlintegrityconstraintviolationexception/</link><pubDate>Wed, 17 Jun 2009 00:00:00 +0000</pubDate><guid>https://www.ericsimmerman.com/blog/2009/06/17/resolve-foreign-key-constraint-error/conflict-with-dbunit-clean_insert-operation-mysqlintegrityconstraintviolationexception/</guid><description>&lt;div class='post'&gt;
&lt;p&gt;If DBUnit starts throwing MySQLIntegrityConstraintViolationException while performing a CLEAN_INSERT you can lose quite a bit of sleep attempting to resolve it or you can cheat and get back to work. The shortcut is to simply disable constraints for the INSERT operation by disabling constraints for DBUnit altogether. You can do that by adding sessionVariables=FOREIGN_KEY_CHECKS=0 to your JDBC connection string to MySQL. I use maven and in pom.xml my configuration for the dbunit plugin looks like this&lt;/p&gt;</description></item></channel></rss>