Bug 794436 (JBEPP-1477) - Duplicated last entry in the user list of the organization portlet
Summary: Duplicated last entry in the user list of the organization portlet
Keywords:
Status: VERIFIED
Alias: JBEPP-1477
Product: JBoss Enterprise Portal Platform 5
Classification: JBoss
Component: Portal
Version: 5.2.0.GA
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 5.2.1.ER02
Assignee: Boleslaw Dawidowicz
QA Contact:
URL: http://jira.jboss.org/jira/browse/JBE...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-12 10:22 UTC by Martin Weiler
Modified: 2023-02-27 07:22 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
A design limitation in the Organization API caused inefficient paginated user queries. This was identified when user duplication occurred across LDAP and within the database, and there was different user data contained in these databases. The portal displayed the last entry in the returned query several times, which caused confusion when interpreting the query results. The fix introduces a configuration switch "countPaginatedUsers", which is configurable in the idm-configuration.xml file. Set the value to false to activate the switch, and improve query accuracy.
Clone Of:
Environment:
EPP 5.2.0 + LDAP
Last Closed: 2012-02-29 21:22:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBEPP-1477 0 Major Closed Duplicated last entry in the user list of the organization portlet 2015-07-18 04:01:56 UTC

Description Martin Weiler 2012-01-12 10:22:27 UTC
Help Desk Ticket Reference: https://na7.salesforce.com/500A000000908DG
project_key: JBEPP

The last user listed in the organization portlet (user management) appears multiple times. If I delete the last user list, the one before him/her appears duplicated. If I search for "*" in the search field, there is no duplicate any more.

Comment 1 Marc Zottner 2012-02-02 18:30:36 UTC
Hi!

It looks like a cache invalidation problem in org.picketlink.idm.impl.api.session.managers.PersistenceManagerImpl

In order to fix it temporarily I made the following fix in org.exoplatform.services.organization.idm.UserDAOImpl:

best regards,

Marc



Index: component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
===================================================================
--- component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java	(revision 8257)
+++ component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java	(working copy)
@@ -468,6 +468,14 @@
          );
       }
 
+      if (q.getUserName() == null &&
+    		  q.getEmail() == null &&
+    		  q.getFirstName() == null &&
+    		  q.getLastName() == null)
+      {
+    	  q.setUserName("*");
+      }
+      
       // if only condition is email which is unique then delegate to other method as it will be more efficient
       if (q.getUserName() == null &&
          q.getEmail() != null &&
@@ -548,19 +556,7 @@
          qb.attributeValuesFilter(UserDAOImpl.USER_LAST_NAME, new String[]{q.getLastName()});
       }
 
-
-
-      if (q.getUserName() == null &&
-         q.getEmail() == null &&
-         q.getFirstName() == null &&
-         q.getLastName() == null)
-      {
-         list = new IDMUserListAccess(qb, 20, true);
-      }
-      else
-      {
-         list = new IDMUserListAccess(qb, 20, false);
-      }
+      list = new IDMUserListAccess(qb, 20, false);
 
       if (cache != null)
       {


Comment 2 boleslaw.dawidowicz 2012-02-16 09:26:03 UTC
Labels: Removed: EPP_5_2_1_Candidate 


Comment 3 Boleslaw Dawidowicz 2012-02-29 21:17:38 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
CAUSE: Portal is not able to perform efficient paginated user query in certain configurations. One such example is when some users are duplicated in both LDAP and DB while both stores also contain different users. In such scenario it is impossible to perform efficient paginated query count and Organization API can return non consistent data. Portal then displays last entry in returned list several times. This is still considered less harmful then returning user list with null data. 

FIX: Configuration switch was provided in idm-configuration.xml to alter this behavior and perform accurate user query instead that will return consistent paginated results. There is "countPaginatedUsers" switch that should be set to "false" to not have duplicated entries in the list.

Comment 6 Jared MORGAN 2012-03-26 03:06:13 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,3 +1 @@
-CAUSE: Portal is not able to perform efficient paginated user query in certain configurations. One such example is when some users are duplicated in both LDAP and DB while both stores also contain different users. In such scenario it is impossible to perform efficient paginated query count and Organization API can return non consistent data. Portal then displays last entry in returned list several times. This is still considered less harmful then returning user list with null data. 
+A bug in the Organization API caused inefficient paginated user queries. This was identified when user duplication occurred across LDAP and within the database, and there was different user data contained in these databases. The portal displayed the last entry in the returned query several times, which was considered less severe than returning a user list with null data. The fix introduces a configuration switch "countPaginatedUsers", which is configurable in the idm-configuration.xml file. The switch should be set to false to prevent duplicated entries in query results.-
-FIX: Configuration switch was provided in idm-configuration.xml to alter this behavior and perform accurate user query instead that will return consistent paginated results. There is "countPaginatedUsers" switch that should be set to "false" to not have duplicated entries in the list.

Comment 7 Boleslaw Dawidowicz 2012-03-26 08:09:04 UTC
Thanks Jared!

Looks accurate however with comment that it is not really a bug that caused it but more design limitation. In certain configuration it prevents to perform paginated query that is both efficient and accurate. Hence user duplicated entries was considered as less harmful outcome. Configuration switch just uses less efficient query that will return accurate results (no duplication) with a performance tradeoff.

Comment 9 Jared MORGAN 2012-03-26 20:38:53 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-A bug in the Organization API caused inefficient paginated user queries. This was identified when user duplication occurred across LDAP and within the database, and there was different user data contained in these databases. The portal displayed the last entry in the returned query several times, which was considered less severe than returning a user list with null data. The fix introduces a configuration switch "countPaginatedUsers", which is configurable in the idm-configuration.xml file. The switch should be set to false to prevent duplicated entries in query results.+A design limitation in the Organization API caused inefficient paginated user queries. This was identified when user duplication occurred across LDAP and within the database, and there was different user data contained in these databases. The portal displayed the last entry in the returned query several times, which caused confusion when interpreting the query results. The fix introduces a configuration switch "countPaginatedUsers", which is configurable in the idm-configuration.xml file. Set the value to false to activate the switch, and improve query accuracy.

Comment 10 Boleslaw Dawidowicz 2012-03-27 21:09:30 UTC
Jared, 

Looks good. Thanks! I will just trust your judgement :)


Note You need to log in before you can comment on or make changes to this bug.