0

When some database constraint fails during the run of dbunit tests, its name is printed out with the exception, e.g.

Caused by: org.hsqldb.HsqlException: integrity constraint violation: foreign   key no parent; FK_AJRY4L84JDA0RY0XHP3A71CQ9 table: <Table name>

Is there any possibility to find out which particular constraint that is resp. which column in the affected table? The displayed constraint name seems to be a generated one.

I could not find anything about it on the internet, so the only thing I do is inspecting the affected table, see which constraints it has and guess which could be violated by my dataset...

Ewgenij Sokolovski
  • 897
  • 1
  • 12
  • 31

1 Answers1

0

Currently, I do the same thing - look at the table definition to find which item has that name.

Since you have a reproducible situation, perhaps you could see what dbUnit knows at that point of the issue and if it can report more info (e.g. inspect the metadata and list the field(s) in that index), then submit a patch that provides more info for that situation. e.g. catches the Exception, wraps it in a DatabaseUnitException with a message containing the dbUnit-found info.

Jeff
  • 956
  • 8
  • 10