{"record":{"id":"1990428598ae1b21","repo":"hibernate/hibernate-orm","slug":"not-implemented-by-caching-provider","errorCode":null,"errorMessage":"Not implemented by caching provider","messagePattern":"Not implemented by caching provider","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"critical","filePath":"hibernate-core/src/main/java/org/hibernate/cache/spi/support/RegionFactoryTemplate.java","lineNumber":46,"sourceCode":"\t\treturn new DomainDataRegionTemplate(\n\t\t\t\tregionConfig,\n\t\t\t\tthis,\n\t\t\t\tcreateDomainDataStorageAccess( regionConfig, buildingContext ),\n\t\t\t\tgetImplicitCacheKeysFactory(),\n\t\t\t\tbuildingContext\n\t\t);\n\t}\n\n\t@Nonnull\n\tprotected CacheKeysFactory getImplicitCacheKeysFactory() {\n\t\treturn DefaultCacheKeysFactory.INSTANCE;\n\t}\n\n\t@Nonnull\n\tprotected DomainDataStorageAccess createDomainDataStorageAccess(\n\t\t\t@Nonnull DomainDataRegionConfig regionConfig,\n\t\t\t@Nonnull DomainDataRegionBuildingContext buildingContext) {\n\t\tthrow new UnsupportedOperationException( \"Not implemented by caching provider\" );\n\t}\n\n\t@Override\n\t@Nonnull\n\tpublic QueryResultsRegion buildQueryResultsRegion(\n\t\t\t@Nonnull String regionName,\n\t\t\t@Nonnull SessionFactoryImplementor sessionFactory) {\n\t\tverifyStarted();\n\t\treturn new QueryResultsRegionTemplate(\n\t\t\t\tregionName,\n\t\t\t\tthis,\n\t\t\t\tcreateQueryResultsRegionStorageAccess( regionName, sessionFactory )\n\t\t);\n\t}\n\n\t@Nonnull\n\tprotected abstract StorageAccess createQueryResultsRegionStorageAccess(\n\t\t\t@Nonnull String regionName,","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/cache/spi/support/RegionFactoryTemplate.java#L28-L64","documentation":"RegionFactoryTemplate is the base class for second-level cache integrations. Its createDomainDataStorageAccess has no default implementation and throws UnsupportedOperationException; every concrete provider must override it to supply the storage object behind a domain data region. Seeing this error means the configured RegionFactory class does not implement the storage creation the template requires, so the SessionFactory cannot build cache regions.","triggerScenarios":"A custom RegionFactory extends RegionFactoryTemplate without overriding createDomainDataStorageAccess; hibernate.cache.region.factory_class points at the template itself or an outdated provider built against an older Hibernate API; a Hibernate upgrade changed the template method signature so an existing override no longer overrides anything.","commonSituations":"Writing an in-house cache integration; upgrading Hibernate major versions while a third-party region factory lags behind; wrong or misspelled factory class name in configuration.","solutions":["Override createDomainDataStorageAccess in your RegionFactoryTemplate subclass to return your DomainDataStorageAccess implementation","Switch to a maintained provider factory (hibernate-jcache with Caffeine/Ehcache, Infinispan) instead of a custom one","Check the hibernate.cache.region.factory_class value for typos and version match with your Hibernate version","Put @Override on every template method you implement so signature drift becomes a compile error"],"exampleFix":"// before\npublic class MyRegionFactory extends RegionFactoryTemplate {\n    // createDomainDataStorageAccess not overridden -> \"Not implemented by caching provider\"\n}\n\n// after\npublic class MyRegionFactory extends RegionFactoryTemplate {\n    @Override\n    protected DomainDataStorageAccess createDomainDataStorageAccess(\n            DomainDataRegionConfig regionConfig,\n            DomainDataRegionBuildingContext context) {\n        return new MyDomainDataStorageAccess(createRegion(regionConfig.getStorageAccessType(), regionConfig));\n    }\n}","handlingStrategy":"validation","validationCode":"// fail fast at config load time\nClass<?> factoryClass = Class.forName(factoryClassName);\nif (Modifier.isAbstract(factoryClass.getModifiers())\n        || !RegionFactoryTemplate.class.isAssignableFrom(factoryClass)) {\n    throw new IllegalStateException(\"Invalid hibernate.cache.region.factory_class: \"\n            + factoryClassName);\n}","typeGuard":null,"tryCatchPattern":"try {\n    sessionFactory = configuration.buildSessionFactory(serviceRegistry);\n} catch (UnsupportedOperationException e) {\n    if (\"Not implemented by caching provider\".equals(e.getMessage())) {\n        throw new IllegalStateException(\n                \"RegionFactory '\" + factoryClassName + \"' is incomplete for this Hibernate version;\"\n                        + \" use a maintained provider or implement createDomainDataStorageAccess\", e);\n    }\n    throw e;\n}","preventionTips":["Run a CI smoke test that builds the SessionFactory with production cache configuration","Pin cache provider versions matched to the Hibernate version","Use maintained providers (hibernate-jcache, Infinispan) unless you can maintain a custom RegionFactory"],"tags":["hibernate","second-level-cache","region-factory","provider-integration","startup"],"backgroundTag":"custom-cache-provider-incomplete","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}