Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-132114

UserModelDocumentContributor.getActiveTransitiveGroupIds is called twice when indexing a User

    Details

      Description

      Steps to Reproduce:

      1. Enable hibernate logs:
        1. org.hibernate.SQL to ALL
        2. org.hibernate.type to ALL
      2. Go to Search > Index Actions and execute "Reindex com.liferay.portal.kernel.model.User."

       

      Expected Results:

      No identical consecutive queries should be executed.

       

      Actual Results:

      The following query gets executed twice per user:

      (SELECT DISTINCT Group_.groupId AS groupId, REPLACE(Group_.name, ' LFR_ORGANIZATION', '') AS groupName, Group_.type_ AS groupType, Group_.friendlyURL AS groupFriendlyURL FROM Group_ INNER JOIN Users_Groups ON Users_Groups.groupId = Group_.groupId WHERE (Group_.liveGroupId = 0) AND (Users_Groups.userId = ?) AND ((Group_.classNameId = ?) OR (Group_.classNameId = ?)) AND (Group_.companyId = ?) AND (Group_.parentGroupId != ?) AND (Group_.liveGroupId = 0) AND (Group_.groupKey != 'Control Panel') AND (LOWER(Group_.name) LIKE ? OR ? IS NULL) AND (LOWER(Group_.description) LIKE ? OR ? IS NULL) AND (Group_.type_ != 4) AND Group_.ctCollectionId = 0) UNION (SELECT DISTINCT Group_.groupId AS groupId, REPLACE(Group_.name, ' LFR_ORGANIZATION', '') AS groupName, Group_.type_ AS groupType, Group_.friendlyURL AS groupFriendlyURL FROM Group_ INNER JOIN Users_Orgs ON Users_Orgs.organizationId = Group_.classPK WHERE Users_Orgs.userId = ? AND (Group_.classNameId = ?) AND (Group_.companyId = ?) AND (Group_.parentGroupId != ?) AND (Group_.liveGroupId = 0) AND (Group_.groupKey != 'Control Panel') AND (LOWER(Group_.name) LIKE ? OR ? IS NULL) AND (LOWER(Group_.description) LIKE ? OR ? IS NULL) AND (Group_.type_ != 4) AND Group_.ctCollectionId = 0) UNION (SELECT DISTINCT Group_.groupId AS groupId, REPLACE(Group_.name, ' LFR_ORGANIZATION', '') AS groupName, Group_.type_ AS groupType, Group_.friendlyURL AS groupFriendlyURL FROM Group_ INNER JOIN Groups_Orgs ON Groups_Orgs.groupId = Group_.groupId INNER JOIN Users_Orgs ON Users_Orgs.organizationId = Groups_Orgs.organizationId WHERE (Group_.liveGroupId = 0) AND (Users_Orgs.userId = ?) AND ((Group_.classNameId = ?) OR (Group_.classNameId = ?)) AND (Group_.companyId = ?) AND (Group_.parentGroupId != ?) AND (Group_.liveGroupId = 0) AND (Group_.groupKey != 'Control Panel') AND (LOWER(Group_.name) LIKE ? OR ? IS NULL) AND (LOWER(Group_.description) LIKE ? OR ? IS NULL) AND (Group_.type_ != 4) AND Group_.ctCollectionId = 0) UNION (SELECT DISTINCT Group_.groupId AS groupId, REPLACE(Group_.name, ' LFR_ORGANIZATION', '') AS groupName, Group_.type_ AS groupType, Group_.friendlyURL AS groupFriendlyURL FROM Group_ INNER JOIN Groups_UserGroups ON Groups_UserGroups.groupId = Group_.groupId INNER JOIN Users_UserGroups ON Users_UserGroups.userGroupId = Groups_UserGroups.userGroupId WHERE (Group_.liveGroupId = 0) AND (Users_UserGroups.userId = ?) AND ((Group_.classNameId = ?) OR (Group_.classNameId = ?)) AND (Group_.companyId = ?) AND (Group_.parentGroupId != ?) AND (Group_.liveGroupId = 0) AND (Group_.groupKey != 'Control Panel') AND (LOWER(Group_.name) LIKE ? OR ? IS NULL) AND (LOWER(Group_.description) LIKE ? OR ? IS NULL) AND (Group_.type_ != 4) AND Group_.ctCollectionId = 0) ORDER BY groupName ASC
      

        Attachments

          Activity

            People

            Assignee:
            melody.wu Melody Wu
            Reporter:
            mariano.alvaro Mariano Álvaro
            Participants of an Issue:
            Recent user:
            Rafaela Nascimento
            Engineering Assignee:
            Mariano Álvaro
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              10 weeks, 5 days ago

                Packages

                Version Package
                7.2.10 DXP FP14
                7.2.10.5 DXP SP5
                7.2.X
                7.3.7 CE GA8
                7.3.10 DXP FP2
                7.3.X
                7.4.1 CE GA2 DXP 7,4
                7.4.2 CE GA3 DXP 7,4
                Master