{"record":{"id":"45a16be283154521","repo":"pentaho/pentaho-kettle","slug":"method-not-implemented-with-upgrade-to-hibernate-5-4-24","errorCode":null,"errorMessage":"Method not Implemented with upgrade to hibernate 5.4.24","messagePattern":"Method not Implemented with upgrade to hibernate 5\\.4\\.24","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"warning","filePath":"engine/src/main/java/org/pentaho/di/www/cache/CarteStatusCache.java","lineNumber":260,"sourceCode":"    throwNotImplemented();\n    return false;\n  }\n\n  @Override public void evict( Class cls, Object primaryKey ) {\n    throwNotImplemented();\n  }\n\n  @Override public void evict( Class cls ) {\n    throwNotImplemented();\n  }\n\n  @Override public <T> T unwrap( Class<T> cls ) {\n    throwNotImplemented();\n    return null;\n  }\n\n  private void throwNotImplemented(){\n    throw new NotImplementedException( \"Method not Implemented with upgrade to hibernate 5.4.24\");\n  }\n}\n","sourceCodeStart":242,"sourceCodeEnd":263,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/www/cache/CarteStatusCache.java#L242-L263","documentation":"CarteStatusCache wraps Hibernate's SessionFactoryImplementor for caching Carte status pages. After the project upgraded to Hibernate 5.4.24, the unused SessionFactory session/eviction operations are deliberately stubbed out; any of them (unwrap, containsEntity, evictEntityData, evictNaturalIdData, containsCollection, evictCollectionData) throws NotImplementedException unconditionally.","triggerScenarios":"Calling getSessionFactory().unwrap(cls), containsEntity, evictEntityData, evictNaturalIdData, containsCollection, or evictCollectionData on the SessionFactory exposed by CarteStatusCache.","commonSituations":"Application code or third-party code (e.g. Spring's LocalSessionFactoryBean or a cache manager) probing the SessionFactory capabilities against this stub; upgrading to the hibernate-5.4.24 build and invoking previously-working session-management methods.","solutions":["Do not call session/eviction methods on the SessionFactory obtained from CarteStatusCache; treat it as a status cache only","Obtain a real SessionFactory from your own Hibernate configuration instead of the one wrapped by CarteStatusCache","Wrap calls in try-catch NotImplementedException if you must probe the factory defensively"],"exampleFix":"// before\nsessionFactory.unwrap( Session.class );\n// after\nif ( isCarteStatusCacheStub( sessionFactory ) ) {\n  // use a real SessionFactory from your Hibernate config instead\n  Session session = realSessionFactory.openSession();\n}","handlingStrategy":"try-catch","validationCode":"if ( isCarteStatusCacheStub( sessionFactory ) ) {\n  throw new UnsupportedOperationException( \"use a real SessionFactory, not the Carte status cache stub\" );\n}","typeGuard":"boolean isRealSessionFactory(SessionFactory f) { try { f.unwrap(Session.class); return true; } catch (NotImplementedException e) { return false; } }","tryCatchPattern":"try {\n  sessionFactory.unwrap( Session.class );\n} catch ( NotImplementedException e ) {\n  // fall back to a real SessionFactory from your Hibernate configuration\n}","preventionTips":["Treat the SessionFactory from CarteStatusCache as a cache-only handle","Read the hibernate upgrade release notes for stubbed/removed APIs","Route all session and eviction work through your application's own SessionFactory"],"tags":["java","hibernate","carte","stub"],"backgroundTag":"method-not-implemented","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}