Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-1975

WorkflowPersistenceManager impl invokes Session#refresh() unnecessarily in its #save() method

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 2.22.10, 2.24.02, 2.25.00-alpha
    • None
    • None

    Description

      #save() method invokes session.refresh(false) as well after session.save().
      This is also unnecessary working more than expected.
      I think client application should invoke #refresh() manually if needed.

      public void save() throws ObjectBeanPersistenceException {
      try

      { session.save(); // also do a refresh, because it is possible that through workflow another jcr session made the changes, and that the current // has no changes, hence a session.save() does not trigger a refresh session.refresh(false); }

      catch (Exception e)

      { throw new ObjectBeanPersistenceException(e); }

      }

      Even though the status is like that as commented, I think it should be manually invoked by clients instead of doing like this implicitly from the core side.
      I don't think it's a good idea to invoke something unexpected. Rather we'd recommend developers what they should do for the cases.

      In many cases, they don't have to refresh the session. In some cases, they do.
      For example, if they want to retrieve beans again which were previously retrieved with the same session.

      The influence of the unexpected #refresh() call could affect performance, too.

      Attachments

        Issue Links

          Activity

            People

              jsheriff Junaidh Kadhar Sheriff
              wko Woonsan Ko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: