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

6.2.x: Dynamic Queries are returning with the wrong values if the dynamicQuery object is reused

    Details

    • Type: Regression Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 6.2.0 CE RC6, 6.2.0 CE GA1, 7.0.0 M3
    • Fix Version/s: 6.2.0 CE GA1
    • Component/s: Asset Framework
    • Labels:
      None
    • Environment:
      Tomcat 7 + MySQL 5. Portal 6.2.x EE GIT ID: da4344f9827c3b811bc16b1a5c66818c793e166f.
      Tomcat 7 + MySQL 5. Portal 6.2.x EE RC6 GIT ID: dd9a8652e2f01391ed1b4d1b059cc32203639c7e.
    • Fix Priority:
      5

      Description

      The dynamicQuery object is being modified when it calls XXXLocalServiceUtil#dynamicQueryCount.

      The second WikiPageLocalServiceUtil#dynamicQuery call will return bad data:

      DynamicQuery wikiPageDynamicQuery = DynamicQueryFactoryUtil.forClass(WikiPage.class);
      
      Property groupIdProperty = PropertyFactoryUtil.forName("groupId");
      
      wikiPageDynamicQuery.add(groupIdProperty.eq(scopeGroupId));
      
      Object object = (Object)WikiPageLocalServiceUtil.dynamicQuery(wikiPageDynamicQuery, 0, 20);
      
      System.out.println(object);
      
      object = (Object)WikiPageLocalServiceUtil.dynamicQueryCount(wikiPageDynamicQuery);
      
      System.out.println(object);
      
      object = (Object)WikiPageLocalServiceUtil.dynamicQuery(wikiPageDynamicQuery, 0, 20);
      
      System.out.println(object);
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                peter.shin Peter Shin
                Reporter:
                justin.choi Justin Choi
                Participants of an Issue:
                Recent user:
                Marta Elicegui
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 41 weeks ago

                  Packages

                  Version Package
                  6.2.0 CE GA1