Menu

#420 NoPrimaryKeyException thrown for synonyms

v2.6.*
pending
None
(not fixed)
5
2019-01-14
2019-01-14
No

Hi,

if I use a refresh operation with an XML file and that XML file uses synonyms instead of table names, the primary keys of the table are not discovered.

Solution would be to implement a read information_schema.synonyms to resolve the table name and then access the indexes table.

Best regards
Matthias

<dataset> <current_id da_db2_table="xxx" client="X" attribute_name="ID_NUMBER" entity_name="yyy"> </current_id></dataset>

IDataSet data = loader.load(testFile);
DatabaseOperation.REFRESH.execute(connection, data);
^^^^
does not work as CURRENT_ID is a synonym and not a table name.

Caused by: org.dbunit.dataset.NoPrimaryKeyException: CURRENT_ID
at org.dbunit.operation.UpdateOperation.getOperationData(UpdateOperation.java:72)
at org.dbunit.operation.RefreshOperation$UpdateRowOperation.<init>(RefreshOperation.java:275)
at org.dbunit.operation.RefreshOperation.createUpdateOperation(RefreshOperation.java:151)
at org.dbunit.operation.RefreshOperation.execute(RefreshOperation.java:103)
at com.hlag.fis.core.test.resources.TestDataConnection.refreshTestData(TestDataConnection.java:140)</init>

Discussion

  • Matthias Kay

    Matthias Kay - 2019-01-14

    Will create a MR.

     
    • Jeff Jensen

      Jeff Jensen - 2019-01-14

      Great, thank you!

       
  • Jeff Jensen

    Jeff Jensen - 2019-01-14
    • status: open --> pending
    • assigned_to: Jeff Jensen
     

Log in to post a comment.