Uploaded image for project: 'MyCoRe'
  1. MCR-1328

Can't delete mods objects with related items of type "host"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 2016.06.0
    • Fix Version/s: 2016.12, 2016.06.0.1
    • Component/s: mycore-mods
    • Labels:
      None

      Description

      If I try to delete an mods object with children I get the following exception:

      ERROR: Command 'delete object zimport_mods_00000009' failed. Performing transaction rollback...
      
      java.lang.reflect.InvocationTargetException
       at sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:483)
       at org.mycore.frontend.cli.MCRCommand.invoke(MCRCommand.java:252)
       at org.mycore.webcli.container.MCRWebCLIContainer$ProcessCallable.runCommand(MCRWebCLIContainer.java:282)
       at org.mycore.webcli.container.MCRWebCLIContainer$ProcessCallable.processCommand(MCRWebCLIContainer.java:250)
       at org.mycore.webcli.container.MCRWebCLIContainer$ProcessCallable.processCommands(MCRWebCLIContainer.java:344)
       at org.mycore.webcli.container.MCRWebCLIContainer$ProcessCallable.call(MCRWebCLIContainer.java:229)
       at org.mycore.webcli.container.MCRWebCLIContainer$ProcessCallable.call(MCRWebCLIContainer.java:179)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
       at java.lang.Thread.run(Thread.java:745)
      Caused by: org.mycore.datamodel.common.MCRActiveLinkException: Error while deleting object zimport_mods_00000009. This object is still referenced by other objects and can not be removed until all links are released.
       at org.mycore.datamodel.metadata.MCRMetadataManager.delete(MCRMetadataManager.java:434)
       at org.mycore.datamodel.metadata.MCRMetadataManager.deleteMCRObject(MCRMetadataManager.java:561)
       at org.mycore.datamodel.metadata.MCRMetadataManager.deleteMCRObject(MCRMetadataManager.java:542)
       at org.mycore.frontend.cli.MCRObjectCommands.delete(MCRObjectCommands.java:142)
       ... 15 more
      
      ERROR: The following command failed: 'delete object zimport_mods_00000009'
      

      In MCRLINKHREF are two entries for each children: a parent entry and a reference host entry.

      mcrfrom                 mcrto                 mcrtype         mcrattr 
      openagrar_mods_00006669 zimport_mods_00000009 parent  
      openagrar_mods_00006669 zimport_mods_00000009 reference       host 
      openagrar_mods_00011398 zimport_mods_00000009 parent  
      openagrar_mods_00011398 zimport_mods_00000009 reference       host 
      openagrar_mods_00011997 zimport_mods_00000009 parent  
      openagrar_mods_00011997 zimport_mods_00000009 reference       host 
      openagrar_mods_00020097 zimport_mods_00000009 parent  
      openagrar_mods_00020097 zimport_mods_00000009 reference       host
      

        Attachments

          Activity

            People

            • Assignee:
              yagee Thomas Scheffler
              Reporter:
              mcrkrebs Kathleen Neumann
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: