{"record":{"id":"2850bd5a359b0b22","repo":"hibernate/hibernate-orm","slug":"region-s-returned-from-regionfactory-s-was-n","errorCode":null,"errorMessage":"Region [%s] returned from RegionFactory [%s] was named differently than requested name.  Expecting `%s`, but found `%s`","messagePattern":"Region \\[(.+?)\\] returned from RegionFactory \\[(.+?)\\] was named differently than requested name\\.  Expecting `(.+?)`, but found `(.+?)`","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/cache/internal/EnabledCaching.java","lineNumber":114,"sourceCode":"\t}\n\n\tprivate TimestampsCache buildTimestampsCache(SessionFactoryImplementor sessionFactory) {\n\t\tfinal var timestampsRegion =\n\t\t\t\tregionFactory.buildTimestampsRegion(\n\t\t\t\t\t\tDEFAULT_UPDATE_TIMESTAMPS_REGION_UNQUALIFIED_NAME,\n\t\t\t\t\t\tsessionFactory\n\t\t\t\t);\n\t\treturn sessionFactory.getSessionFactoryOptions().getTimestampsCacheFactory()\n\t\t\t\t.buildTimestampsCache( this, timestampsRegion );\n\t}\n\n\t@Override\n\tpublic void prime(@Nonnull Set<DomainDataRegionConfig> cacheRegionConfigs) {\n\t\tfor ( var regionConfig : cacheRegionConfigs ) {\n\t\t\tfinal var region = buildRegion( regionConfig );\n\t\t\tregionsByName.put( region.getName(), region );\n\t\t\tif ( !Objects.equals( region.getName(), regionConfig.getRegionName() ) ) {\n\t\t\t\tthrow new HibernateException(\n\t\t\t\t\t\tString.format(\n\t\t\t\t\t\t\t\tLocale.ROOT,\n\t\t\t\t\t\t\t\t\"Region [%s] returned from RegionFactory [%s] was named differently than requested name.  Expecting `%s`, but found `%s`\",\n\t\t\t\t\t\t\t\tregion,\n\t\t\t\t\t\t\t\tgetRegionFactory().getClass().getName(),\n\t\t\t\t\t\t\t\tregionConfig.getRegionName(),\n\t\t\t\t\t\t\t\tregion.getName()\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\t\t\t// Entity caching\n\n\t\t\tfor ( var entityAccessConfig : regionConfig.getEntityCaching() ) {\n\t\t\t\tfinal var navigableRole = entityAccessConfig.getNavigableRole();\n\t\t\t\tentityAccessMap.put( navigableRole, region.getEntityDataAccess( navigableRole ) );\n\t\t\t}","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/cache/internal/EnabledCaching.java#L96-L132","documentation":"Error \"Region [%s] returned from RegionFactory [%s] was named differently than requested name.  Expecting `%s`, but found `%s`\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Second-level caching is misconfigured or a cache region/key does not match what Hibernate expects.","commonSituations":"Enabling @Cacheable entities without setting hibernate.cache.region.factory_class, custom RegionFactory implementations, or unwrapping Cache to provider types.","solutions":["Fix the custom RegionFactory so getRegion() returns a region whose name matches the requested name."],"exampleFix":"Fix the custom RegionFactory so getRegion() returns a region whose name matches the requested name.","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"}