Opened 16 years ago
Closed 9 years ago
#1148 closed defect (fixed)
Removing items from trashcan when circular references exists ...
Reported by: | Jari Häkkinen | 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 by , 16 years ago
Milestone: | → BASE 3.0 |
---|
comment:2 by , 16 years ago
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 by , 16 years ago
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:
- Change the owner of the directory to another user.
- 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 by , 9 years ago
Component: | web → core |
---|---|
Milestone: | BASE Future Release → BASE 3.8 |
Owner: | changed from | to
Status: | new → assigned |
comment:5 by , 9 years ago
comment:6 by , 9 years ago
(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 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
All tests have now been completed successfully.
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.