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

Trying to delete, purge and re-create an resource in a transaction causes error

    XMLWordPrintable

    Details

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

      Description

      If you create a container.

      Then in a long-running transaction you delete, purge and re-add the container you get a 409 Conflict as it tries to add a second row to the containment index.

      Like the Fedora to OCFL id mapping we should change the containment index to use upsert queries to handle this.

      Error listed is
      WARN 09:40:29.341 (ContainmentIndexImpl) Unable to commit containment index transaction c7d4d7d3-16a8-4dcf-a94f-f8343d78811f: PreparedStatementCallback; SQL [INSERT INTO resources ( fedora_id, parent ) SELECT fedora_id, parent FROM transaction_operations WHERE transaction_id = ? AND operation = 'add']; Duplicate entry 'info:fedora/test_transaction/e71fa71d-00b2-4057-8c08-e8ec7b2fb62' for key 'resources.PRIMARY'; nested exception is java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'info:fedora/test_transaction/e71fa71d-00b2-4057-8c08-e8ec7b2fb62' for key 'resources.PRIMARY'

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            whikloj Jared Whiklo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated: