Legacy Knowledge Base
Published Sep. 10, 2025

Understanding a "There is no order guarantee on which result is returned" Portlet Preferences warning when using embedded Hypersonic

Written By

Isaac Wilson

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • When unzipping and launching a 7.1 SP4 bundle, the following WARN is shown in the logs:
    2020-09-30 15:21:30.057 WARN [http-nio-8080-exec-2][PortalPreferencesPersistenceImpl:208] PortalPreferencesPersistenceImpl.fetchByO_O(long, int, boolean) with parameters (20103,4) yields a result set with more than 1 result. This violates the logical unique restriction. There is no order guarantee on which result is returned by this finder.
  • We have not made any configurations to this bundle yet, so it is using the embedded HSQL/Hypersonic database

Environment

  • DXP 7.3 SP1 (DXP-1+) bundle with the embedded HSQL database
  • DXP 7.2 SP4 (DXP-11+) bundle with the embedded HSQL database
  • DXP 7.1 SP4 (DXP-17+) bundle with the embedded HSQL database
  • DXP 7.0 SP14 (DE-93+) bundle with the embedded HSQL database

Resolution

  • Since the embedded Hypersonic database is not intended for production environments, and this warning is only reproduced when using the embedded database, creating and using a database type listed on the 7.1 Compatibility Matrix will resolve this warning
  • For testing environments (where the embedded database is sufficient), this WARN can be safely ignored, as it will not affect the logic despite the WARN's messaging

Additional Information

  • The root cause of the issue is due to a duplicated insert statement within the service pack's data/hypersonic/lportal.script file (which is used to populate the embedded Hypersonic database, and is planned to be edited with LPS-112912); specifically, a race condition that can be encountered with some fix packs causes that script to perform something like:
    INSERT INTO PORTALPREFERENCES VALUES(0,33949,20103,4,'<portlet-preferences />')
    INSERT INTO PORTALPREFERENCES VALUES(0,33950,20103,4,'<portlet-preferences />')
  • Since this process is only performed once (when the HSQL database is initialized), it is also possible to resolve this warning (though unnecessary, since the WARN is benign) using a Groovy statement in Server Administration, with a structure such as (for 7.1):
    com.liferay.portal.kernel.service.PortalPreferencesLocalServiceUtil.deletePortalPreferences(33949L)
    Please be aware that scripts should only be executed at your team's discretion, and that adequate backups should be maintained in case a rollback is required. 
  • More information on the embedded Hypersonic database can be found in Installing Liferay DXP
Did this article resolve your issue ?

Legacy Knowledge Base