{"record":{"id":"224432e67870a645","repo":"hibernate/hibernate-orm","slug":"could-not-read-a-hi-value-populate-the-table","errorCode":null,"errorMessage":"Could not read a hi value, populate the table: ","messagePattern":"Could not read a hi value, populate the table: ","errorType":"exception","errorClass":"IdentifierGenerationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/id/enhanced/TableStructure.java","lineNumber":167,"sourceCode":"\t\t\t\t\t\t\tpublic Long execute(Connection connection) throws SQLException {\n\t\t\t\t\t\t\t\tlong value;\n\t\t\t\t\t\t\t\tint rows;\n\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\ttry ( var selectStatement = prepareStatement(\n\t\t\t\t\t\t\t\t\t\t\tconnection,\n\t\t\t\t\t\t\t\t\t\t\tselectQuery,\n\t\t\t\t\t\t\t\t\t\t\tstatementLogger,\n\t\t\t\t\t\t\t\t\t\t\tstatsCollector,\n\t\t\t\t\t\t\t\t\t\t\tsession\n\t\t\t\t\t\t\t\t\t) ) {\n\t\t\t\t\t\t\t\t\t\ttry ( var resultSet = executeQuery(\n\t\t\t\t\t\t\t\t\t\t\t\tselectStatement,\n\t\t\t\t\t\t\t\t\t\t\t\tstatsCollector,\n\t\t\t\t\t\t\t\t\t\t\t\tselectQuery,\n\t\t\t\t\t\t\t\t\t\t\t\tsession\n\t\t\t\t\t\t\t\t\t\t) ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !resultSet.next() ) {\n\t\t\t\t\t\t\t\t\t\t\t\tthrow new IdentifierGenerationException(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Could not read a hi value, populate the table: \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ physicalTableName );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tvalue = extractLong( resultSet, 1 );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcatch (SQLException sqle) {\n\t\t\t\t\t\t\t\t\t\tTABLE_GENERATOR_LOGGER.unableToReadHiValue( physicalTableName.render(), sqle );\n\t\t\t\t\t\t\t\t\t\tthrow sqle;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\ttry ( var updateStatement = prepareStatement(\n\t\t\t\t\t\t\t\t\t\t\tconnection,\n\t\t\t\t\t\t\t\t\t\t\tupdateQuery,\n\t\t\t\t\t\t\t\t\t\t\tstatementLogger,\n\t\t\t\t\t\t\t\t\t\t\tstatsCollector,\n\t\t\t\t\t\t\t\t\t\t\tsession\n\t\t\t\t\t\t\t\t\t) ) {","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/id/enhanced/TableStructure.java#L149-L185","documentation":"Error \"Could not read a hi value, populate the table: \" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown when a table-based id generator finds no row to read its next hi value from.","commonSituations":"Typical situations: the generator table was created but not initialized; wrong segment/row key configured.","solutions":["Insert an initial row into the id generator table so a hi value can be read.","Verify the segment column value matches the configured segment name."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}