{"record":{"id":"6f309353715e261a","repo":"pentaho/pentaho-kettle","slug":"this-partition-schema-is-still-in-use-by-one-or-more","errorCode":null,"errorMessage":"This partition schema is still in use by one or more transformations ({0}) :","messagePattern":"This partition schema is still in use by one or more transformations \\((.+?)\\) :","errorType":"exception","errorClass":"KettleDependencyException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryPartitionSchemaDelegate.java","lineNumber":228,"sourceCode":"      repository.connectionDelegate.performDelete( \"DELETE FROM \"\n        + quoteTable( KettleDatabaseRepository.TABLE_R_PARTITION ) + \" WHERE \"\n        + quote( KettleDatabaseRepository.FIELD_PARTITION_ID_PARTITION_SCHEMA ) + \" = ? \", id_partition_schema );\n      repository.connectionDelegate.performDelete(\n        \"DELETE FROM \"\n          + quoteTable( KettleDatabaseRepository.TABLE_R_PARTITION_SCHEMA ) + \" WHERE \"\n          + quote( KettleDatabaseRepository.FIELD_PARTITION_SCHEMA_ID_PARTITION_SCHEMA ) + \" = ? \",\n        id_partition_schema );\n    } else {\n      StringBuilder message = new StringBuilder( 100 );\n\n      message.append( \"The partition schema is used by the following transformations:\" ).append( Const.CR );\n      for ( int i = 0; i < transList.length; i++ ) {\n        message.append( \"  \" ).append( transList[i] ).append( Const.CR );\n      }\n      message.append( Const.CR );\n\n      KettleDependencyException e = new KettleDependencyException( message.toString() );\n      throw new KettleDependencyException(\n        \"This partition schema is still in use by one or more transformations (\" + transList.length + \") :\", e );\n    }\n  }\n}\n","sourceCodeStart":210,"sourceCodeEnd":233,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryPartitionSchemaDelegate.java#L210-L233","documentation":"delPartitionSchema throws KettleDependencyException when the partition schema is still referenced by one or more transformations. Deleting it would break those transformations, so the repository refuses and lists the dependent transformation names in the message.","triggerScenarios":"Calling delPartitionSchema(id) while rows exist in the transformation partition schema mapping table referencing that ID (transList.length > 0).","commonSituations":"Cleanup scripts deleting shared partitioning configs still used by production transformations; deleting a schema from a repo shared by multiple teams; stale transformations that were never re-pointed after a refactor.","solutions":["Re-point or update the listed transformations to another partition schema, then delete","Delete/retire the dependent transformations first if they are obsolete","If deletion is truly intended, remove the dependency rows via the repository API deliberately","Catch KettleDependencyException and report the dependent transformation list to the user"],"exampleFix":"// before\ndelegate.delPartitionSchema(schemaId);\n// after\ntry {\n  delegate.delPartitionSchema(schemaId);\n} catch (KettleDependencyException e) {\n  log.warn(\"Schema in use: \" + e.getMessage() + \" — update dependents first\");\n  // re-point transformations, then retry deletion\n}","handlingStrategy":"try-catch","validationCode":"// before deleting, check dependencies via repository lookups of transformation->partition schema mappings","typeGuard":null,"tryCatchPattern":"try { delegate.delPartitionSchema(id); } catch (KettleDependencyException e) { log.warn(\"Dependent transformations: \" + e.getMessage()); /* re-point or delete dependents first */ }","preventionTips":["Parse the exception message to enumerate dependent transformations for the user","Re-point transformations to another schema before deleting","Run dependency checks in cleanup scripts before issuing deletes","Treat shared partition schemas as immutable in multi-team repositories"],"tags":["repository","dependency","partition-schema","delete"],"backgroundTag":"invalid-state-transition","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"}