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?
You seem to have CSS turned off.
Please don't fill out this field.
Is the relation "A.ID_B" enabled? Do B have a PK? If you like, you can send the jailer.log to email@example.com s.t. I can see what actually happened.
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
Using an SQL export gives the same result only 13 rows of B. So it's related to DBUnit format.
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?
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
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?
It's difficult to tell without knowing what exactly has happened. Maybe the log file would by helpful.
I 've just sent you the logs
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)
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?
ID_A | ID_B
1 | 1
2 | 2
4 | 2
The row from Table A with ID_A = 3 is not exported because ID_B is null
No. If A is the subject-table (where the export starts from), then all rows from A fulfilling the subject-condition will be exported.
Then what's wrong? Why are rows missing? What is the condition which makes rows being excluded from export?
It's difficult again to tell without knowing what exactly has happened. Maybe the log file would by helpful.
We already exchanged by email last week (remember geo_commune?). By the way I can provide any extra information you need.
Last week you exported "geo_commune Where id_commune = 38236" and you got 1 "geo_commune". What rows are you missing?
Nope for this particular example: the generated file is empty (despite the logs):
Sorry, I didn't notice that you also sent the xml file. I will look into the issue.
What's the type of the column "geo_commune.id_commune"?
It's of type SMALLINT
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.
Bingo! You solved it.
Thank you very much!
Sign up for the SourceForge newsletter: