{"record":{"id":"23adf8128b3c3b55","repo":"pentaho/pentaho-kettle","slug":"the-shared-objects-metadata-store-doesn-t-support-deleting-23adf8","errorCode":null,"errorMessage":"The shared objects metadata store doesn't support deleting element types","messagePattern":"The shared objects metadata store doesn't support deleting element types","errorType":"exception","errorClass":"MetaStoreException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/shared/SharedObjectsMetaStore.java","lineNumber":112,"sourceCode":"    }\n    return null;\n  }\n\n  @Override\n  public void createElementType( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException,\n    MetaStoreElementTypeExistsException {\n    throw new MetaStoreException( \"The shared objects metadata store doesn't support creating new element types\" );\n  }\n\n  @Override\n  public void updateElementType( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException {\n    throw new MetaStoreException( \"The shared objects metadata store doesn't support updating element types\" );\n  }\n\n  @Override\n  public void deleteElementType( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException,\n    MetaStoreDependenciesExistsException {\n    throw new MetaStoreException( \"The shared objects metadata store doesn't support deleting element types\" );\n  }\n\n  @Override\n  public List<IMetaStoreElement> getElements( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException {\n    List<IMetaStoreElement> list = new ArrayList<IMetaStoreElement>();\n    for ( SharedObjectInterface sharedObject : sharedObjects.getObjectsMap().values() ) {\n      // The databases...\n      //\n      if ( sharedObject instanceof DatabaseMeta && databaseElementType.getName().equals( elementType.getName() ) ) {\n        list.add( DatabaseMetaStoreUtil.populateDatabaseElement( this, (DatabaseMeta) sharedObject ) );\n      }\n    }\n    return list;\n  }\n\n  @Override\n  public List<String> getElementIds( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException {\n    List<String> ids = new ArrayList<String>();","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/shared/SharedObjectsMetaStore.java#L94-L130","documentation":"Unsupported-operation sentinel in SharedObjectsMetaStore.deleteElementType(): the shared-objects metadata store is a read-only view over XML-defined shared objects, so deleting element types is refused, mirroring the same guard for create and update.","triggerScenarios":"Any call to SharedObjectsMetaStore.deleteElementType(namespace, elementType), e.g. cleanup code removing types before re-creating them.","commonSituations":"Reset/migration scripts that rebuild metastore content from scratch; test teardown code deleting all types.","solutions":["Do not delete element types in this metastore; delete individual elements instead via deleteElement","Skip deletion when the metastore is SharedObjectsMetaStore","Use a writable metastore (MemoryMetaStore etc.) for scenarios needing type lifecycle"],"exampleFix":"// before\nfor ( IMetaStoreElementType t : metaStore.getElementTypes( ns ) ) metaStore.deleteElementType( ns, t );\n// after\nif ( !( metaStore instanceof SharedObjectsMetaStore ) ) {\n  for ( IMetaStoreElementType t : metaStore.getElementTypes( ns ) ) metaStore.deleteElementType( ns, t );\n}","handlingStrategy":"validation","validationCode":"if ( metaStore instanceof SharedObjectsMetaStore ) {\n  // delete elements, not types\n  metaStore.deleteElement( ns, elementType, elementId );\n} else {\n  metaStore.deleteElementType( ns, elementType );\n}","typeGuard":"boolean supportsTypeDeletion = !( metaStore instanceof SharedObjectsMetaStore );","tryCatchPattern":"try {\n  metaStore.deleteElementType( ns, type );\n} catch ( MetaStoreException e ) {\n  logger.warn( \"Type deletion unsupported; delete individual elements instead\" );\n}","preventionTips":["For cleanup, iterate elements and delete them individually","Skip type teardown for read-only-type metastores","Use MemoryMetaStore in tests when type lifecycle is exercised"],"tags":["metastore","unsupported-operation","pdi"],"backgroundTag":"unsupported-operation","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"}