Does DBUnit DatabaseSequenceFilter work for MySQL?

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

Does DBUnit DatabaseSequenceFilter work for MySQL?

Duncan McGregor
I'm dumping the whole contents of my MySQL database to file with
DBUnit, and getting MySQLIntegrityConstraintViolationException: Cannot
delete or update a parent row: a foreign key constraint fails ... when
reading back in.

The tables are being written in alphabetical order, even though I use
the DatabaseSequenceFilter to reorder them by dependency.

filter = new DatabaseSequenceFilter(connection);
dataset = new FilteredDataSet(filter, connection.createDataSet());
FlatXmlDataSet.write(dataset, w)

The database clearly has the foreign key constraints specified (I can
see them, and they wouldn't fail on import if they weren't there).

Has anyone seen DatabaseSequenceFilter working for MySQL? If so, am I
missing anything obvious?

Thanks in anticipation

Duncan McGregor

------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management
Up to 160% more powerful than alternatives and 25% more efficient.
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user