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

When you have many roles in Liferay, it increases the size of the queries past 2000, making it fail in SQL Server

    Details

      Description

      when Liferay has more than 2000 roles and is using SQL Server, performing certain actions (such as creating a Messageboard post or creating a Site from a Site Template) will throw a JDBC error.

      Steps to Reproduce
      1. Setup Liferay to use SQL Server 2008 R2
      2. Create 10,000 roles. You can use the attached make-data-portlet-6.1.20.1.war
      Scenario 1
      3. Go to Control Panel -> Messageboard
      4. Make a new post
      You'll see that Liferay throws the attached error, Prepared or callable statement has more than 2000 parameter markers.
      Scenario 2
      5. Go to Control Panel -> Sites
      6. Click on Add, and select the Community template
      7. Add the Site.
      You'll see a GUI error saying that the Site creation failed, and the attached error.
      The Site will have been created, but there will be no pages.
      Errors
      See attached SQL-server-error.txt

      refer to LPP-11111

      reproduced in: 6.1.x, 6.2.x
      couldn't reproduced in master due to not being able to upgrade database, however, the code is the same in 6.2.x and master for this issue.

      identified cause of this issue: ResourcePermissionLocalServiceImpl.hasResourcePermissions() calling findByC_N_S_P_R(), which will loop through all the roles and create a single query with all the roles as parameters.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              joshua.gok Joshua Gok (Inactive)
              Reporter:
              xinsui.zhao Xinsui Zhao (Inactive)
              Participants of an Issue:
              Recent user:
              Brian Wulbern
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                8 years, 15 weeks ago

                  Packages

                  Version Package
                  7.0.0 M3