#1873 closed defect (fixed)
Deleting child biomaterial doesn't return the used quantity to the parent
Reported by: | Nicklas Nordborg | Owned by: | everyone |
---|---|---|---|
Priority: | critical | Milestone: | BASE 3.3.3 |
Component: | core | Version: | |
Keywords: | Cc: |
Description
- Create a sample S1 and set original quantity to 500.
- Create a child sample S2 and set used quantity from parent to 250.
- The S1 sample now has remaining quantity=250.
- Delete sample S2 completely (remove from trashcan).
- The S1 sample still has remaining quantity=250.
Change History (6)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
I have investigated this and found a problem resulting from #1759. Changing to lazy-loading results in Hibernate creating proxy objects that are always a subclass of BioMaterialData
and not of the actual real class (eg. SampleData
or ExtractData
). We also have MeasuredBioMaterialData
in this hierarchy and in the code that returns the used quantity we have a check biomaterial instanceof MeasuredBioMaterialData
which now returns false since we have a proxy object here. The result is that quantities are never returned.
comment:3 by , 10 years ago
comment:4 by , 10 years ago
(In [6578]) References #1873: Deleting child biomaterial doesn't return the used quantity to the parent
There is no a onetimefix
script for fixing this. After updating BASE it should be executed (from the bin directory):
onetimefix.sh remaining_quantity -u <root login> -p <root pwd>
where login and password is for the root user account in BASE.
comment:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:6 by , 10 years ago
(In [6585]) References #1873: Deleting child biomaterial doesn't return the used quantity to the parent
Test program for change history failed now that the remaining quantity is updated when a child item is deleted. This generates an extra entry in the change history table for the parent item that wasn't accounted for.
Once this is fixed we also need to create a procedure for re-calculating the remaining quantity for all existing samples, since we don't know which ones have been affected by this bug.