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

BasePersistenceImpl.fetchByPrimaryKeys does not honor database.in.max.parameters

    Details

      Description

      Steps to reproduce

      1. Start up Liferay pointing to an Oracle database
      2. Run the following Groovy script to create 1200 AnnouncementsFlag entries (it's a small table so it should finish quickly)
        import com.liferay.announcements.kernel.service.AnnouncementsFlagLocalService
        import com.liferay.registry.RegistryUtil
        
        def registry = RegistryUtil.getRegistry()
        def announcementsFlagLocalService = registry.getServices(AnnouncementsFlagLocalService.class, null)[0]
        
        if (announcementsFlagLocalService.getAnnouncementsFlagsCount() < 1200) {
        	for (int i = 0; i < 1200; i++) {
        		announcementsFlagLocalService.addFlag(0, i, 0)
        	}
        }
        
      3. Run the following Groovy script, which fetches the 1200 AnnouncementsFlag entries, clears the entity cache, and then re-fetches them again
        import com.liferay.portal.kernel.dao.orm.EntityCacheUtil
        import com.liferay.portal.kernel.dao.orm.FinderCacheUtil
        import com.liferay.announcements.kernel.service.AnnouncementsFlagLocalService
        import com.liferay.registry.RegistryUtil
        
        def registry = RegistryUtil.getRegistry()
        def announcementsFlagLocalService = registry.getServices(AnnouncementsFlagLocalService.class, null)[0]
        
        FinderCacheUtil.clearCache()
        
        out.println("finding results (finder cache miss)")
        
        try {
        	out.println("find attempt succeeded: " + announcementsFlagLocalService.getAnnouncementsFlags(-1, -1).size())
        }
        catch (Exception e) {
        	e.printStackTrace(out)
        }
        
        out.println("finding results (finder cache hit)")
        
        EntityCacheUtil.clearCache()
        
        try {
        	out.println("find attempt succeeded: " + announcementsFlagLocalService.getAnnouncementsFlags(-1, -1).size())
        }
        catch (Exception e) {
        	e.printStackTrace(out)
        }
        

      Expected behavior: The second Groovy script runs without errors
      Actual behavior: The second Groovy script is able to successfully fetch prior to clearing the entity cache, but prints a stack trace after clearing the entity cache

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              summer.zhang Summer Zhang
              Reporter:
              minhchau.dang Minhchau Dang
              Participants of an Issue:
              Recent user:
              Clarissa Velazquez
              Engineering Assignee:
              Minhchau Dang
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                13 weeks ago

                  Packages

                  Version Package
                  7.2.10 DXP FP15
                  7.2.X
                  7.3.X
                  7.4.2 CE GA3 DXP 7,4
                  Master