Uploaded image for project: 'Hippo Repository'
  1. Hippo Repository
  2. REPO-1576

NodeUpdaterService doesn't enforce using a system session and persist changes upon invoking a NodeUpdaterVisitor

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 4.0.1
    • Fix Version/s: 4.0.3
    • Labels:
      None
    • Similar issues:
    • Story Points:
      2
    • Processed by team:
      Platform
    • Sprint:
      Platform Sprint 138

      Description

      The NodeUpdaterService is used by the CMS to ensure document (by node type) are updated on first usage. This allows lenient updating of document on first usage.
      However the NodeUpdateVisitor (with matching property hipposys:nodetype) when invoked from the NodeUpdaterService should execute with a node retrieved by a system session, the same as when executing the NodeUpdateVisitor through the UpdaterExecutor.
      Likewise, after successful execution the (possibly) update session state should be persisted.

      With earlier defined NodeUpdateVisitor scripts (like the v7.9 HardHandleUpdateVisitor), this logic was 'embedded' in the NodeUpdateVisitor itself, therefore the omssion of (forced) doing this wasn't detected before.

      However, requiring to take care of this logic from within the NodeUpdateVisitor is non-transparent and undesirable from performance POV, as it requires a direct session save on every #doUpdate(Node) execution. This would seriously degrade the performance when executing the same NodeUpdateVisitor batch wise using the UpdateExcutor.
      Case in point: the HippoTranslationToDisplayName updater for v11.0 (REPO-1356), which was discovered through CMS-10423
      Note: for the HardHandleUpdateVisitor this wasn't an issue as it had to do a save on each Node update anyhow.

      To fix this the NodeUpdateVisitor when invoked from the NodeUpdateService within UpdaterRegistry, will now enforce:

      • using the system session from the NodeUpdateVisitor to load the node to update
      • before successful return perform a system session.save
        The NodeUpdateVisitor therefore doesn't need to take care of this logic anymore (it won't harm either).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                adouma Ate Douma
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: