Legacy Knowledge Base
Published Sep. 10, 2025

java.sql.BatchUpdateException: Duplicate entry errors

Written By

Kanchan Bisht

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

  • Duplicate entry error when switching from Hypersonic to MySQL using the setup wizard
  • Steps to reproduce
    1) Start portal with hypersonic
    2) In Setup Wizard, add test@liferay.com as an email
    3) Click to change the default database
    4) Change database type to MySQL
    5) Change username to root (or local MySQL username)
    6) Add MySQL password
    7) Click finish configuration
    8) Restart portal
    Expected Behavior: Portal is connected to MySQL without errors
    Observed Behavior: The following error appears in the console
    LIFERAY_ERROR: HHH000315: Exception executing batch [java.sql.BatchUpdateException: Duplicate entry '43802-0-com.liferay.site.util_recentGroups-com.liferay.portal.ke' for key 'IX_A6DD0ECF'], SQL: insert into PortalPreferenceValue (mvccVersion, companyId, portalPreferencesId, index_, key_, largeValue, namespace, smallValue, portalPreferenceValueId) values (?, ?, ?, ?, ?, ?, ?, ?, ?)
    [exec] LIFERAY_ERROR: Duplicate entry '43802-0-com.liferay.site.util_recentGroups-com.liferay.portal.ke' for key 'IX_A6DD0ECF'

Environment

  • Liferay DXP 7.4

Resolution

  • The observed behavior is a known regression bug which is being addressed here: LPS-180393

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base