{"record":{"id":"8bebf3ebea2e5c64","repo":"pentaho/pentaho-kettle","slug":"transmeta-exception-kettledatabaserepositorytransdelegate","errorCode":null,"errorMessage":"TransMeta.Exception.DatabaseErrorOccuredReadingTransformation","messagePattern":"TransMeta\\.Exception\\.DatabaseErrorOccuredReadingTransformation","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryTransDelegate.java","lineNumber":653,"sourceCode":"            + transMeta.getName() );\n        }\n        if ( log.isDetailed() ) {\n          log.logDetailed( BaseMessages.getString( PKG, \"TransMeta.Log.LoadedTransformation2\", transname, String\n            .valueOf( transMeta.getRepositoryDirectory() == null ) ) );\n          log\n            .logDetailed( BaseMessages.getString(\n              PKG, \"TransMeta.Log.LoadedTransformation\", transname, transMeta.getRepositoryDirectory().getPath() ) );\n        }\n\n        // close prepared statements, minimize locking etc.\n        //\n        repository.connectionDelegate.closeAttributeLookupPreparedStatements();\n\n        return transMeta;\n      } catch ( KettleDatabaseException e ) {\n        log.logError( BaseMessages.getString( PKG, \"TransMeta.Log.DatabaseErrorOccuredReadingTransformation\" )\n          + Const.CR + e );\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"TransMeta.Exception.DatabaseErrorOccuredReadingTransformation\" ), e );\n      } catch ( Exception e ) {\n        log.logError( BaseMessages.getString( PKG, \"TransMeta.Log.DatabaseErrorOccuredReadingTransformation\" )\n          + Const.CR + e );\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"TransMeta.Exception.DatabaseErrorOccuredReadingTransformation2\" ), e );\n      } finally {\n        transMeta.initializeVariablesFrom( null );\n        if ( setInternalVariables ) {\n          transMeta.setInternalKettleVariables();\n        }\n      }\n    }\n  }\n\n  /**\n   * Load the transformation name & other details from a repository.\n   */","sourceCodeStart":635,"sourceCodeEnd":671,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryTransDelegate.java#L635-L671","documentation":"Wrapper thrown by loadTransformation when a KettleDatabaseException occurs while reading the transformation from the repository. The error is logged and rethrown as a KettleException with the cause attached. It indicates the repository database read failed (not that data was missing).","triggerScenarios":"KettleDatabaseException during any read step of loadTransformation: attribute lookups, loading steps/hops/notes/partition schemas/slaves, or repository connection failures mid-load.","commonSituations":"Repository database restarted or connection timed out during a long load; corrupt repository rows; prepared-statement/connection leaks; DB permissions revoked mid-session.","solutions":["Inspect the logged cause for the underlying SQL/JDBC error and fix connectivity or data issues first.","Reconnect to the repository (repository.disconnect()/connect()) and retry the load.","Check repository table integrity for the transformation's rows (R_TRANSFORMATION, R_TRANS_STEP, etc.).","Verify DB user still holds SELECT rights on repository tables."],"exampleFix":"// before\nTransMeta tm = repository.loadTransformation(name, dir, monitor, true, null); // throws KettleException\n// after\ntry {\n  TransMeta tm = repository.loadTransformation(name, dir, monitor, true, null);\n} catch (KettleException e) {\n  Throwable cause = e.getCause();\n  if (cause instanceof KettleDatabaseException) {\n    repository.disconnect();\n    repository.connect(user, password); // refresh connection and retry once\n  } else {\n    throw e;\n  }\n}","handlingStrategy":"retry","validationCode":"if (!repository.isConnected()) { repository.connect(user, password); }","typeGuard":null,"tryCatchPattern":"try { return repository.loadTransformation(name, dir, monitor, true, null); } catch (KettleException e) { if (e.getCause() instanceof KettleDatabaseException && attempts < 2) { repository.disconnect(); repository.connect(user, password); continue; } throw e; }","preventionTips":["Keep repository connections alive/refreshed before long loads","Monitor repository DB health","Check DB user SELECT permissions on repository tables","Log and inspect the wrapped cause before assuming data corruption"],"tags":["repository","database-read","transformation-load"],"backgroundTag":"database-query-failed","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"}