com.mdbtest.ExportException

com.healthmarketscience.jackcess.ConstraintViolationException: Adding new row [10, null] violates constraint Foreign Key from B[FK] (secondary) to A[ID] (primary) (Db=export_test887929677054003886.mdb)

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web1

  • com.healthmarketscience.jackcess.ConstraintViolationException: Adding new row [10, null] violates constraint Foreign Key from B[FK] (secondary) to A[ID] (primary) (Db=export_test887929677054003886.mdb)
  • Stack trace

    • com.mdbtest.ExportException: com.healthmarketscience.jackcess.ConstraintViolationException: Adding new row [10, null] violates constraint Foreign Key from B[FK] (secondary) to A[ID] (primary) (Db=export_test887929677054003886.mdb) at com.mdbtest.TestAccdbFK.main(TestAccdbFK.java:35) Caused by: com.healthmarketscience.jackcess.ConstraintViolationException: Adding new row [10, -1] violates constraint Foreign Key from B[FK] (secondary) to A[ID] (primary) (Db=ngm_export_test887929677054003886.mdb) at com.healthmarketscience.jackcess.impl.FKEnforcer.requirePrimaryValues(FKEnforcer.java:224) at com.healthmarketscience.jackcess.impl.FKEnforcer.addRow(FKEnforcer.java:132) at com.healthmarketscience.jackcess.impl.TableImpl.addRows(TableImpl.java:1595) at com.healthmarketscience.jackcess.impl.TableImpl.addRow(TableImpl.java:1462) at com.mdbtest.TestAccdbFK.main(TestAccdbFK.java:25)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You’re the first here who have seen this exception.