db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Dudziak" <tom...@gmail.com>
Subject Re: Could not read data file data.xml
Date Fri, 05 Jan 2007 23:26:27 GMT
On 1/5/07, Philip Mark Donaghy <philip.donaghy@gmail.com> wrote:
> I get this error often and I would like to report my findings. This
> happens when a data element contains a reference to a foreign key not
> present in the document.

This is because by default, the ensureForeignKeyOrder parameter for
the writeDataToDatabase subtask is set to true. This will cause
DdlUtils to defer the insertion of rows until all rows that this row
references, are already written to the database.
If you update DdlUtils and set the new verbosity flag to debug, then
DdlUtils will write out which rows are held back and why.

> Aside from this I experienced a problem where I have a table with many
> foreign keys none of which are required. When I dump the data using
> ddlutils I get an element that looks like this.
>
> <DOCUMENTS ID="1998858" LABEL="Google Earth image of site.jpg"
> FILE_NAME="Google Earth image of site.jpg" CUSTOMER_PROPOSAL_FK="0"
> EQUIPMENT_FK="0" CIRCUIT_PROVIDER_FK="0" CUSTOMER_FK="2031623"
> LOCATION_FK="0" CIRCUIT_FK="0"/>
>
> I havn't investigated too much but those foreign keys with a value of
> "0" are actually null and should not appear.

Could you post more info (which db, the relevant schema, etc.) ?
DdlUtils in general does not modify the data so this might be
something that the JDBC driver returns.

Tom

Mime
View raw message