-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.2.X, 7.3.X, Master
-
Fix Version/s: 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, 7.4.2 CE GA3, 7.4.13 DXP GA1, Master
-
Component/s: User Management
-
Branch Version/s:7.3.x, 7.2.x
-
Backported to Branch:Committed
-
Fix Priority:4
-
Git Pull Request:
Steps to Reproduce:
- Enable hibernate logs:
- org.hibernate.SQL to ALL
- org.hibernate.type to ALL
- 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