{"record":{"id":"e903fb15f3e99a0e","repo":"hibernate/hibernate-orm","slug":"persistence-context-reported-no-row-snapshot-for","errorCode":null,"errorMessage":"persistence context reported no row snapshot for {infoString}","messagePattern":"persistence context reported no row snapshot for (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java","lineNumber":384,"sourceCode":"\t\t\t\tfinal Object[] naturalIdSnapshotSubSet = new Object[ props.length ];\n\t\t\t\tfor ( int i = 0; i < props.length; i++ ) {\n\t\t\t\t\tnaturalIdSnapshotSubSet[i] = entitySnapshot[ props[i] ];\n\t\t\t\t}\n\t\t\t\tnaturalIdResolutions.cacheResolutionFromLoad( id, naturalIdSnapshotSubSet, persister );\n\t\t\t\treturn naturalIdSnapshotSubSet;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate EntityPersister locateProperPersister(EntityPersister persister) {\n\t\treturn persister.getRootEntityDescriptor().getEntityPersister();\n\t}\n\n\t@Override\n\tpublic Object[] getCachedDatabaseSnapshot(EntityKey key) {\n\t\tfinal Object snapshot = entitySnapshotsByKey == null ? null : entitySnapshotsByKey.get( key );\n\t\tif ( snapshot == NO_ROW ) {\n\t\t\tthrow new IllegalStateException(\n\t\t\t\t\t\"persistence context reported no row snapshot for \"\n\t\t\t\t\t\t\t+ infoString( key.getEntityName(), key.getIdentifier() )\n\t\t\t);\n\t\t}\n\t\treturn (Object[]) snapshot;\n\t}\n\n\t@Override\n\tpublic EntityHolder claimEntityHolderIfPossible(\n\t\t\tEntityKey key,\n\t\t\tObject entity,\n\t\t\tJdbcValuesSourceProcessingState processingState,\n\t\t\tEntityInitializer<?> initializer) {\n\t\tfinal var entityHolderMap = getOrInitializeEntitiesByKey();\n\t\tvar holder = getOrInitializeNewHolder().withEntity( key, key.getPersister(), entity );\n\t\tfinal var oldHolder = entityHolderMap.putIfAbsent( key, newEntityHolder );\n\t\tif ( oldHolder != null ) {\n\t\t\t// An initializer can't claim an entity holder if it's already initialized","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java#L366-L402","documentation":"Error \"persistence context reported no row snapshot for {infoString}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown at hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java:384 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reload the entity in the current persistence context so a row snapshot exists","Avoid merging/updating an entity whose snapshot was evicted; re-read it first"],"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"}