Uploaded image for project: 'Metadata Deploy Module'
  1. Metadata Deploy Module
  2. DPLY-28

Don't save an object that hasn't changed

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • TBD
    • Resolution: Won't Fix
    • None
    • None
    • Undetermined

    Description

      The way that Metadata Deploy module typically works is that it overwrites all the metadata on every startup.

      The advantage is that this was an easy-to-implement way to ensure you end up in the correct state.

      One unfortunate side-effect is that it messes up dateChanged from all your metadata (i.e. it always appears updated on the last system startup).

      Another problem is that some types of metadata are supposed to be immutable, and re-saving them (even with no changes) throws an exception.

      Example:

      org.openmrs.api.APIException: This order frequency cannot be edited because it is already in use
      	at org.openmrs.api.impl.OrderServiceImpl.saveOrderFrequency(OrderServiceImpl.java:712)
      ...
      

      We should explore whether there's a good generic way that MDD can avoid actually calling save() when doing overwrite() doesn't actually modify the object. (I'm afraid this will require a non-backwards-compatible method signature change to the overwrite method to have it return a boolean, or something like that.)

      Gliffy Diagrams

        Attachments

          Activity

            People

              grace Grace Potma
              darius Darius Jazayeri
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: