Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-1420

Exception handling for deleting a metadata field (XMLUI)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Volunteer Needed (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.0
    • Fix Version/s: None
    • Component/s: XMLUI
    • Labels:
      None
    • Attachments:
      0
    • Comments:
      0

      Description

      DS-12 fixed this problem long time ago in JSPUI.

      But in XMLUI after deleting a metadata field that still has values present this error page shows up:

      org.postgresql.util.PSQLException: ERROR: update or delete on table "metadatafieldregistry" violates foreign key constraint "metadatavalue_metadata_field_id_fkey" on table "metadatavalue"
      Detail: Key (metadata_field_id)=(90) is still referenced from table "metadatavalue".

      Here's the Java stacktrace:
      rg.postgresql.util.PSQLException: ERROR: update or delete on table "metadatafieldregistry" violates foreign key constraint "metadatavalue_metadata_field_id_fkey" on table "metadatavalue"
      Detail: Key (metadata_field_id)=(90) is still referenced from table "metadatavalue".
      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
      at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
      at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:334)
      at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
      at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
      at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
      at org.dspace.storage.rdbms.DatabaseManager.updateQuery(DatabaseManager.java:421)
      at org.dspace.storage.rdbms.DatabaseManager.deleteByValue(DatabaseManager.java:572)
      at org.dspace.storage.rdbms.DatabaseManager.delete(DatabaseManager.java:536)
      at org.dspace.storage.rdbms.DatabaseManager.delete(DatabaseManager.java:760)
      at org.dspace.content.MetadataField.delete(MetadataField.java:485)
      at org.dspace.app.xmlui.aspect.administrative.FlowRegistryUtils.processDeleteMetadataField(FlowRegistryUtils.java:398)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              helix84 Ivan Masár
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: