hibernate/hibernate-orm · error · IdentifierGenerationException

Could not read a hi value, populate the table:

Error message

Could not read a hi value, populate the table: 

What it means

Error "Could not read a hi value, populate the table: " thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/id/enhanced/TableStructure.java:167

							public Long execute(Connection connection) throws SQLException {
								long value;
								int rows;
								do {
									try ( var selectStatement = prepareStatement(
											connection,
											selectQuery,
											statementLogger,
											statsCollector,
											session
									) ) {
										try ( var resultSet = executeQuery(
												selectStatement,
												statsCollector,
												selectQuery,
												session
										) ) {
											if ( !resultSet.next() ) {
												throw new IdentifierGenerationException(
														"Could not read a hi value, populate the table: "
																+ physicalTableName );
											}
											value = extractLong( resultSet, 1 );
										}
									}
									catch (SQLException sqle) {
										TABLE_GENERATOR_LOGGER.unableToReadHiValue( physicalTableName.render(), sqle );
										throw sqle;
									}

									try ( var updateStatement = prepareStatement(
											connection,
											updateQuery,
											statementLogger,
											statsCollector,
											session
									) ) {

View on GitHub (pinned to fad1729dce)

Solutions

  1. Insert an initial row into the id generator table so a hi value can be read.
  2. Verify the segment column value matches the configured segment name.

When it happens

Trigger: Thrown when a table-based id generator finds no row to read its next hi value from.

Common situations: Typical situations: the generator table was created but not initialized; wrong segment/row key configured.


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/224432e67870a645. Report an issue: GitHub.