Legacy Knowledge Base
公開されました Sep. 10, 2025

Generated counter increment IDs jump by 100 after restarting Liferay

Written By

Hamasaki Yutaro

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.

NOTE
This article was machine-translated and may contain translation errors. Please use the feedback button to report any issues.

Issue

  • Liferay's database transaction counter function seems to increase by 100 after each system restart.

Environment

  • DXP 7.0+

Resolution

  • When Liferay stores data in the database, the counter function automatically retrieves its numbering. To prevent overloading the database, this numbering is pre-assigned in batches according to the configured counter.increment value (100 by default).
  • At startup, Liferay obtains the current counter value and reserves the next counter batch. Each write operation consumes the reserved quota until the allocation runs out and the next batch is reserved. If Liferay restarts before all reserved IDs are used, those unused IDs are skipped. Since the next batch starts after these reserved values, a gap appears in the numbering to account for those unused IDs.

Additional Information

  • While you can reduce the counter.increment value to 1 to ensure missing numbers never appear even after a restart, this is not recommended as it reduces performance by requiring additional database transactions for every new ID.
  • For additional discussion about the Counter Service increasing by 100 after server restarts, see the attached HistoricMBThread-UnderstandingCounterServiceIncrement.pdf.
  • Why are User-ID counters decreasing in a cluster system?
Did this article resolve your issue ?

Legacy Knowledge Base