Legacy Knowledge Base
Published Sep. 10, 2025

When attempting to use a Read/Write database split configuration, the Liferay startup logging warns that Hypersonic is in use

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 setting up an environment that uses a read/write database split, it appears that Liferay tries to use Hypersonic (HSQL) instead of the configured database, as the startup logs note:
    WARN  [main][DialectDetector:100] Liferay is configured to use Hypersonic as its database. Do NOT use Hypersonic in production. Hypersonic is an embedded database useful for development and demonstration purposes. The database settings can be changed in portal-ext.properties.
    INFO  [main][DialectDetector:158] Using dialect com.liferay.portal.dao.orm.hibernate.HSQLDialect for HSQL Database Engine 2.3
    INFO  [main][DialectDetector:158] Using dialect org.hibernate.dialect.MySQLDialect for MySQL 5.7
  • Since Hypersonic is not supported for Production, is it possible to know whether Liferay is currently using HSQL or MySQL in this environment? Is there a configuration change that can prevent the /hypersonic directory from being created and this logging from being seen during startup?

Environment

  • DXP 7.1

Resolution

  • To prevent the /hypersonic directory from being created and the HSQL messages from being logged, instead of removing the properties that start with jdbc.default.* from the portal-ext.properties file during the read/write configuration steps, leave that set of properties present (un-commented) when adding the jdbc.read.* and jdbc.write.* properties, so all three sets are included. For example:
    jdbc.default.driverClassName=com.mysql.jdbc.Driver
    jdbc.default.url=jdbc:mysql://localhost:port/WriteDatabaseName?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&useFastDateParsing=false&useUnicode=true
    jdbc.default.username=username
    jdbc.default.password=password

    jdbc.read.driverClassName=com.mysql.jdbc.Driver
    jdbc.read.url=jdbc:mysql://localhost:port/ReadDatabaseName?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&useFastDateParsing=false&useUnicode=true
    jdbc.read.username=username
    jdbc.read.password=password

    jdbc.write.driverClassName=com.mysql.jdbc.Driver
    jdbc.write.url=jdbc:mysql://localhost:port/WriteDatabaseName?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&useFastDateParsing=false&useUnicode=true
    jdbc.write.username=username
    jdbc.write.password=password
    ...
  • Alternately, the HSQL message in the logs can be ignored, as Hypersonic is not used once the jdbc.read.* and jdbc.write.* properties are picked up by the portal. If choosing this method, it may be beneficial to set setup.wizard.enabled=false within the portal-ext.properties file when starting up the bundle for the first time, as this will prevent the bundle from launching the setup wizard on first startup and encountering a "Default Database (Hypersonic)" note within the UI for that initial launch.

Additional Information

  • This behavior is observed due to the current design of the DBInitUtil class, which explicitly looks (when the infrastructure-spring.xml file is loaded) for the portal properties that start with jdbc.default.* during startup (which are not necessarily present within the configured properties of an environment using a read/write split). Once the dynamic-data-source-infrastructure-spring.xml is additionally loaded shortly thereafter, the portal is then able to recognize the additional jdbc.read.* and jdbc.write.* properties, and uses the databases defined in those properties for portal operations.
  • Though the method to do so will vary by database vendor, transaction logging can be enabled in both the Read and Write databases (outside of Liferay) to verify whether the read and write transactions are using their associated respective databases as expected, if needed.
  • A feature request has been opened to look into restructuring the DBInitUtil class to wait for the dynamic-data-source-infrastructure-spring.xml file to be additionally checked before the portal defaults to HSQL, and can be followed here: LPS-129633.

 

Did this article resolve your issue ?

Legacy Knowledge Base