Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-15103

Allow property update through deltas for better concurrency

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0
    • Component/s: Core, Core MongoDB, Core VCS
    • Tags:
    • Impact type:
      API change
    • Upgrade notes:
      Hide

      A new scalar type, DeltaLong, is introduced, in order to specify that an update through a Long property should be done incrementally at the database level.

      Standard usage is to add "count" to a property is:

      long count = 1;
      Number oldValue = (Number) doc.getPropertyValue("myprop");
      Number newValue = DeltaLong.deltaOrLong(oldValue, count);
      doc.setPropertyValue("myprop", newValue);

      DeltaLong.deltaOrLong(oldValue, count) is used in preference over new DeltaLong(oldValue, count) because it can deal with the case where the old value is null or already a DeltaLong.

      Show
      A new scalar type, DeltaLong, is introduced, in order to specify that an update through a Long property should be done incrementally at the database level. Standard usage is to add "count" to a property is: long count = 1; Number oldValue = (Number) doc.getPropertyValue("myprop"); Number newValue = DeltaLong.deltaOrLong(oldValue, count); doc.setPropertyValue("myprop", newValue); DeltaLong.deltaOrLong(oldValue, count) is used in preference over new DeltaLong(oldValue, count) because it can deal with the case where the old value is null or already a DeltaLong.
    • Sprint:
      Sprint RepoTeam 5.9.5-2

      Description

      There is a need for document fields that are updated at the storage level using atomic increment/decrement operations.

      This is needed for instance to allow concurrent delta updates of fields without losing information. A typical use case is the quotas.

      In addition to delta updates, we still need to be able to set the fields to some fixed value (maybe 0 is enough), for "reset"-like operations.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: