db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip Mark Donaghy" <philip.dona...@gmail.com>
Subject Re: Could not read data file data.xml
Date Wed, 10 Jan 2007 23:05:49 GMT
Hi Tom, per your request for further details...

On 1/6/07, Thomas Dudziak <tomdzk@gmail.com> wrote:
> 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.

Cool I'll check this out.

> > 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"
> >
> > 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.

The database is Derby and I'm using the Client driver. Derby
is running the NetworkServer framework on a single machine with Java

The relevant part of the schema is,

    <table name="DOCUMENTS">
      <column name="ID" primaryKey="true" required="true"
type="BIGINT" size="19" autoIncrement="false"/>
      <column name="LABEL" primaryKey="false" required="true"
type="VARCHAR" size="256" autoIncrement="false"/>
      <column name="FILE_NAME" primaryKey="false" required="false"
type="VARCHAR" size="256" autoIncrement="false"/>
      <column name="REMARKS" primaryKey="false" required="false"
type="VARCHAR" size="4096" autoIncrement="false"/>
      <column name="CUSTOMER_PROPOSAL_FK" primaryKey="false"
required="false" type="BIGINT" size="19" autoIncrement="false"/>
      <column name="EQUIPMENT_FK" primaryKey="false" required="false"
type="BIGINT" size="19" autoIncrement="false"/>
      <column name="CIRCUIT_PROVIDER_FK" primaryKey="false"
required="false" type="BIGINT" size="19" autoIncrement="false"/>
      <column name="CUSTOMER_FK" primaryKey="false" required="false"
type="BIGINT" size="19" autoIncrement="false"/>
      <column name="LOCATION_FK" primaryKey="false" required="false"
type="BIGINT" size="19" autoIncrement="false"/>
      <column name="CIRCUIT_FK" primaryKey="false" required="false"
type="BIGINT" size="19" autoIncrement="false"/>
      <foreign-key foreignTable="CIRCUIT" name="DOCUMENTS_CIRCUIT_FKC">
        <reference local="CIRCUIT_FK" foreign="ID"/>
      <foreign-key foreignTable="CIRCUIT_PROVIDER"
        <reference local="CIRCUIT_PROVIDER_FK" foreign="ID"/>
      <foreign-key foreignTable="CUSTOMER" name="DOCUMENTS_CUSTOMER_FKC">
        <reference local="CUSTOMER_FK" foreign="ID"/>
      <foreign-key foreignTable="CUSTOMER_PROPOSAL"
        <reference local="CUSTOMER_PROPOSAL_FK" foreign="ID"/>
      <foreign-key foreignTable="EQUIPMENT" name="DOCUMENTS_EQUIPMENT_FKC">
        <reference local="EQUIPMENT_FK" foreign="ID"/>
      <foreign-key foreignTable="LOCATION" name="DOCUMENTS_LOCATION_FKC">
        <reference local="LOCATION_FK" foreign="ID"/>

I haven't checked if my framework is setting these columns to 0. I
shouldn't exclude the possiblility.

I would also like to move from Hibernate to OJB. Is there any quick
way to get started with OJB from ddltutils?

Thanks for your time,

> Tom

Philip Donaghy
donaghy.blogspot.com del.icio.us/donaghy/philip
Skype: philipmarkdonaghy
Office: +33 5 56 60 88 02
Mobile: +33 6 20 83 22 62

View raw message