Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-1396

Some elements on an entity page can be rendered against stale data.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.12.1
    • Fix Version/s: 1.12.2
    • Component/s: Core
    • Labels:
      None

      Description

      In the contactapp (github.com/incodehq/contactapp), if edit a ContactGroup, then the Country title/icon are shown as null. This seems to be because they are being rendered against a stale version of the ContactGroup, ie after the JDO transaction has completed.

      Two different fixes.

      The first would seem to be to move the stuff that builds the EntityPage component hierarchy out of the EntityPage constructor and into the EntityPage's onBeforeRender() method.

      This works, but does solve the underlying issue. Talking with martin-g, he says this ought not to be necessary and pointed to a possible issue with the EntityModel (impl of LoadableDetachableModel).

      Further investigation shows that this is indeed where the issue is. EntityModel holds a lazily-populated cache of ScalarModels, keyed by property(Id). This is not cleared down on detach, meaning that a subsequent rendering of the property containing the reference to the country is using a stale ObjectAdapter (never detached) that refers to a pojo that was reset at the end of the preceding transaction.

        Activity

        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 18b54ebadad9978698f4d67127a6d1ffdbbb1c96 in isis's branch refs/heads/master from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=18b54eb ]

        ISIS-1396: detaching an EntityModel should cascade the detach to all child property ScalarModels.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 18b54ebadad9978698f4d67127a6d1ffdbbb1c96 in isis's branch refs/heads/master from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=18b54eb ] ISIS-1396 : detaching an EntityModel should cascade the detach to all child property ScalarModels.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 0b3826d2d4a9b239d891452018f5f0da310a565d in isis's branch refs/heads/master from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=0b3826d ]

        ISIS-1396: minor refactoring of EntityPage (extract method is all).

        Show
        jira-bot ASF subversion and git services added a comment - Commit 0b3826d2d4a9b239d891452018f5f0da310a565d in isis's branch refs/heads/master from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=0b3826d ] ISIS-1396 : minor refactoring of EntityPage (extract method is all).
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit da3f1ecee896c88559019e98b863f0d062980798 in isis's branch refs/heads/maintenance-1.12.x from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=da3f1ec ]

        ISIS-1396: detaching an EntityModel should cascade the detach to all child property ScalarModels.

        Show
        jira-bot ASF subversion and git services added a comment - Commit da3f1ecee896c88559019e98b863f0d062980798 in isis's branch refs/heads/maintenance-1.12.x from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=da3f1ec ] ISIS-1396 : detaching an EntityModel should cascade the detach to all child property ScalarModels.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit da3f1ecee896c88559019e98b863f0d062980798 in isis's branch refs/heads/master from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=da3f1ec ]

        ISIS-1396: detaching an EntityModel should cascade the detach to all child property ScalarModels.

        Show
        jira-bot ASF subversion and git services added a comment - Commit da3f1ecee896c88559019e98b863f0d062980798 in isis's branch refs/heads/master from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=da3f1ec ] ISIS-1396 : detaching an EntityModel should cascade the detach to all child property ScalarModels.

          People

          • Assignee:
            danhaywood Dan Haywood
            Reporter:
            danhaywood Dan Haywood
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development