OFBiz
  1. OFBiz
  2. OFBIZ-4857

Check in GenericEntity.set whether the new value is different from the current one

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: framework
    • Labels:
      None

      Description

      In GenericEntity.set(String name, Object value, boolean setIfNull) after the necessary type conversions and checks it should first be verified that the new value is different from the currently set, before the state is set to changed/modified and observers are notified. E.g. (line 432 ff.):

      GenericEntity.java
            Object old = fields.get(name);
                  
            if(!ObjectUtils.equals(old, value)) {
                fields.put(name, value);
                generateHashCode = true;
                modified = true;
                this.setChanged();
                this.notifyObservers(name);
            }
      

      Also the store in the GenericDelegator should be dependant on the modified-flag of the GenericValue to save.
      Update operations could be done more elegantly, and execution time would potentially be saved.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Uwe Allner
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development