Uploaded image for project: 'Fedora Repository Project'
  1. Fedora Repository Project
  2. FCREPO-3356

Improve duplicate key exception

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Received
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: Fedora 6.0.0
    • Fix Version/s: None
    • Component/s: f4-core
    • Labels:
      None

      Description

      An exception like the following is thrown when a duplicate key is added to the OCFL index:

      org.springframework.dao.DuplicateKeyException: PreparedStatementCallback; SQL [INSERT INTO ocfl_id_map (fedora_id, fedora_root_id, ocfl_id) VALUES (?, ?, ?)]; Unique index or primary key violation: "PUBLIC.PRIMARY_KEY_6 ON PUBLIC.OCFL_ID_MAP(FEDORA_ID) VALUES 1"; SQL statement:INSERT INTO ocfl_id_map (fedora_id, fedora_root_id, ocfl_id) VALUES (?, ?, ?) [23505-200]; nested exception is org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Unique index or primary key violation: "PUBLIC.PRIMARY_KEY_6 ON PUBLIC.OCFL_ID_MAP(FEDORA_ID) VALUES 1"; SQL statement:INSERT INTO ocfl_id_map (fedora_id, fedora_root_id, ocfl_id) VALUES (?, ?, ?) [23505-200]

      This should be replaced with an exception that gives a better indication of what's going on, ie what the duplicate value is.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            pwinckles Peter Winckles
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support