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

Unable to get assetEntries using Oracle

    Details

      Description

      You can reproduce this at least if you use one of the following databases:

      • Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
      • Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

      Steps to reproduce:
      1- Login as administrator
      2- Go to control panel/server administration/script
      3- Select Groovy and paste the following script:

       
      import com.liferay.portlet.asset.service.persistence.AssetEntryQuery;
      import com.liferay.portlet.asset.model.AssetEntry;
      import com.liferay.portlet.asset.service.AssetEntryLocalServiceUtil;
      
      
      AssetEntryQuery assetEntryQuery = new AssetEntryQuery();
      assetEntryQuery.setAllCategoryIds(1);
      List<AssetEntry> assetEntryList = AssetEntryLocalServiceUtil.getEntries(assetEntryQuery);
      

      4- Execute it.

      The following exception is thrown:
      [JDBCExceptionReporter:82] ORA-00932: inconsistent datatypes: expected - got CLOB [Sanitized]_

      Root cause:
      This error is caused by LPS-44439 since it switches the following fields:

      • AssetEntry.description
      • AssetEntry.summary
      • JournalArticle.description

      From VARCHAR to CLOB. When we do this we have to be sure that we don't include these kind of fields in a SELECT DISTINCT statement since Oracle doesn't support it. However, the method AssetEntryFinderImpl.buildAssetQuerySQL() includes the fields AssetEntry.description and AssetEntry.summary in that kind of statment so the exception is displayed.

      TECHNICAL NOTE
      It's unable to reproduce this in some versions of Oracle 11g since the method that we have pointed out previously also includes the primary key (entryId) in the SELECT DISTINCT so this clause is useless. Oracle 11g checks this in order to not generate an error. For example, the error is not displayed for Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

        Attachments

        1. fixed.png
          fixed.png
          75 kB
        2. reproduced.png
          reproduced.png
          64 kB

          Issue Links

            Activity

              People

              Assignee:
              hong.zhao Hong Zhao (Inactive)
              Reporter:
              alberto.chaparro Alberto Chaparro
              Participants of an Issue:
              Recent user:
              Brian Wulbern
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                7 years, 9 weeks, 3 days ago

                  Packages

                  Version Package
                  6.1.X EE
                  6.2.2 CE GA3
                  6.2.X EE
                  7.0.0 M1