Opened 9 years ago
Closed 9 years ago
#1989 closed defect (fixed)
Change history logging doesn't log old values for date annotations
Reported by: | Nicklas Nordborg | Owned by: | everyone |
---|---|---|---|
Priority: | critical | Milestone: | BASE 3.7.1 |
Component: | core | Version: | |
Keywords: | Cc: |
Description
For some reason it seems like the change history log is missing the old values when modifying an annotation of date type.
Other annotation types (strings, numbers, etc.) seems to work and so do regular property value (including dates).
Change History (5)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
comment:3 by , 9 years ago
The first idea that the method should be final was tried but turned out to not work. The reason is that Hibernate is not happy with final methods when they are combined with lazy initialization. It turned out that the logging stopped working for all types of values. The reason seemed to be that we suddenly had two different ParameterValueData
instances representing the same entry in the database. One of the instances saved the old values just as expected, but when Hibernate got hold if it the other instance was used that didn't have the old values.
comment:4 by , 9 years ago
comment:5 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
It was not so difficult to find out why this was happening. Keeping track of the old values is implemented in ParameterValueData (line 143-163). The DateParameterValueData (line 83-99) overrides the method in the superclass and is thereby bypassing the change history logging.
I think we should make the method in
ParameterValueData
final so that it can't be overridden in subclasses. Then we need to find another solution for the requirements for theDateParameterValueData
class.