Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Missing rows in export

Help
Gerald
2014-05-22
2014-05-28
  • Gerald
    Gerald
    2014-05-22

    I have A table A with FK to table B (A.ID_B reference B.ID)

    In the DBUnit export, I have rows from A referencing rows on B which are not present in the export. Said differently, the DBUnit export can not be loaded becauses rows are missing in B to satisfy the foreign key.

    I have disabled a bunch of (reverse) relations. Is there a trick?

     
  • Ralf Wisser
    Ralf Wisser
    2014-05-22

    Is the relation "A.ID_B" enabled? Do B have a PK? If you like, you can send the jailer.log to rwisser@users.sourceforge.net s.t. I can see what actually happened.

     
  • Gerald
    Gerald
    2014-05-22

    The Jailer logs says 17 rows have been exported for table B but in the DBUnit file there are only 13.

    Stranger than that, I export the missing rows from B doing b.ID in (1,2,3), the DBUnit export only contains B row with Id 3

     
  • Gerald
    Gerald
    2014-05-22

    Using an SQL export gives the same result only 13 rows of B. So it's related to DBUnit format.

     
  • Ralf Wisser
    Ralf Wisser
    2014-05-22

    In jailer log you will also find the statement with which the rows from B will be selected. It's something like "Select ... From JAILER_ENTITY E join B T on ... order by B.ID". Would you post it here please?

     
  • Gerald
    Gerald
    2014-05-22

    Forget about the question.
    The database has FKs which are not validated, hence A points to rows in B which don't exist.
    Sorry for this silly question

     
  • Gerald
    Gerald
    2014-05-23

    After some more testing, there is still something I don't understand.
    B as FK ID_C to C, I extract Bs and Cs using a where clause "B.ID_B in (1,2,3,4)". Jailer says "Collected Rows: 4" "Exported Rows: 0". The C rows are not collected at all. How is it possible?

     
  • Ralf Wisser
    Ralf Wisser
    2014-05-23

    It's difficult to tell without knowing what exactly has happened. Maybe the log file would by helpful.

     
  • Gerald
    Gerald
    2014-05-23

    From what I see the missing rows are always range of IDs: for collected IDs 1,2,3,4,5,6,7,8,9 the exported IDs are 1,2,3,7,8,9 (missing 4,5,6)
    Most of the time though, the missing range is the tail, the biggest/last IDs are missing, for example exported IDs are 1,2,3,4,5,6 (missing 7,8,9)

     
  • Gerald
    Gerald
    2014-05-27

    My understanding of this question is that if I have a table A with a foreign key ID_B on table B and I want to export rows from A and B. Jailer won't export rows from table A where ID_B is null.
    Am I right?

    Example:
    Table A
    ID_A | ID_B
    1 | 1
    2 | 2
    3 |[null]
    4 | 2

    Table B
    ID_B
    1
    2

    The row from Table A with ID_A = 3 is not exported because ID_B is null

     
  • Ralf Wisser
    Ralf Wisser
    2014-05-27

    No. If A is the subject-table (where the export starts from), then all rows from A fulfilling the subject-condition will be exported.

     
  • Gerald
    Gerald
    2014-05-27

    Then what's wrong? Why are rows missing? What is the condition which makes rows being excluded from export?

     
  • Ralf Wisser
    Ralf Wisser
    2014-05-27

    It's difficult again to tell without knowing what exactly has happened. Maybe the log file would by helpful.

     
  • Gerald
    Gerald
    2014-05-27

    We already exchanged by email last week (remember geo_commune?). By the way I can provide any extra information you need.

     
  • Ralf Wisser
    Ralf Wisser
    2014-05-27

    Last week you exported "geo_commune Where id_commune = 38236" and you got 1 "geo_commune". What rows are you missing?

     
  • Gerald
    Gerald
    2014-05-27

    Nope for this particular example: the generated file is empty (despite the logs):

     
    Last edit: Gerald 2014-05-27
    Attachments
  • Ralf Wisser
    Ralf Wisser
    2014-05-27

    Sorry, I didn't notice that you also sent the xml file. I will look into the issue.

     
  • Ralf Wisser
    Ralf Wisser
    2014-05-28

    The value "38236" is out the of range of SMALLINT. The column "id_commune" is propably of type SMALLINT UNSIGNED.
    I've added some type-replacement in the configuration file. Please replace your jailer.xml with the attached file an have a try.

     
    Last edit: Ralf Wisser 2014-05-28
    Attachments
  • Gerald
    Gerald
    2014-05-28

    Bingo! You solved it.
    Thank you very much!

     


Anonymous


Cancel   Add attachments