Opened 12 years ago

Closed 5 years ago

#1148 closed defect (fixed)

Removing items from trashcan when circular references exists ...

Reported by: jari Owned by: Nicklas Nordborg
Priority: major Milestone: BASE 3.8
Component: core Version: 2.8.3
Keywords: Cc:

Description

is probably not easy. However, when an item is blocked by another item that is also marked for deletion, couldn't that item be removed? Or is it necessary to descend to the other item and try to remove it first? Should we try to make the trashcan removal smarter?

Change History (7)

comment:1 Changed 12 years ago by Nicklas Nordborg

Milestone: BASE 3.0

The trashcan is already "smart" when the items are in a tree. It will remove the leafs first, and then continue up as far as possible. Circular references has to be manually broken first. It is not possible to detect and unlink this automatically.

comment:2 Changed 12 years ago by jari

So what you mean is that I have to edit the item itself and remove any associations and the delete? Well, there is not much to do but to accept it. I understand the difficulty of building a proper garbage collector. This sure is a 3.0 or even 4.0 issue. Will it ever be fixed?

comment:3 Changed 12 years ago by Nicklas Nordborg

The circular reference must be broken. One example is when a user is the owner of it's own home-directory. Then there is a circular reference from user --> homeDirectory -> owner. This link can be broken in two ways:

  1. Change the owner of the directory to another user.
  2. Set the homeDirectory of the user till null

Other circular references can, for example, happen when groups are members in other groups or when biomaterials are (incorrectly) pooled. The user/home directory case is a simple case that only involves two items, the other two examples can have circle of any length.

comment:4 Changed 5 years ago by Nicklas Nordborg

Component: webcore
Milestone: BASE Future ReleaseBASE 3.8
Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:5 Changed 5 years ago by Nicklas Nordborg

(In [7080]) References #1148: Removing items from trashcan when circular references exists

The trashcan implementation can now detect items that have circulare references. It doesn't yet know how to to break them though.

comment:6 Changed 5 years ago by Nicklas Nordborg

(In [7082]) References #1148: Removing items from trashcan when circular references exists

Implemented code for breaking circular references in the following cases:

  • Any-to-any links. This is done by the trashcan code.
  • User->Home directory.
  • Biomaterial->Biomaterial.
  • Derived bioassay->Derived bioassay.

Groups can also have circular references to other groups but that is resolved by cascade delete in Hibernate.

Right now I can't think of any more places that can result in circular references.

comment:7 Changed 5 years ago by Nicklas Nordborg

Resolution: fixed
Status: assignedclosed

All tests have now been completed successfully.

Note: See TracTickets for help on using tickets.