1 Reply Latest reply on May 13, 2002 7:50 PM by dsundstrom

    Cascading delete

    erikture

      Hello!

      I am using that latest from CVS.
      I have a question regarding "circular" cascading delete.
      I have three objects, Folder, File and ShorcutFile.
      The File and the ShortcutFile objects have both relations to the Folder object. The ShortcutFile object has a relation to the File object. The File and the ShortcutFile objects can be related to the same or different Folder objects. If I remove a File object I want the related ShortcutFile object to be removed. Therefore I have a cascade delete on that relation. If I remove a Folder object I also want the related File and ShortcutFile objects to be removed, so I have cascade delete between the Folder ant those two objects as well.

      The problem is if I remove a Folder object to which both the File and ShortcutFile object is related. The cascade delete between the Folder and the File object triggers. Then the cascade delete between the File and the ShortcutFile triggers as well as the cascade delete between the Folder and the ShortcutFile object. One of the two last cascade delete fails becase the other have already removed the object.

      How shall I do to get it to work?

      /Erik Turesson