{"record":{"id":"37c71910f367afa7","repo":"pentaho/pentaho-kettle","slug":"jobentrywaitforsql-unablesaverep","errorCode":null,"errorMessage":"JobEntryWaitForSQL.UnableSaveRep","messagePattern":"JobEntryWaitForSQL\\.UnableSaveRep","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/waitforsql/JobEntryWaitForSQL.java","lineNumber":315,"sourceCode":"    try {\n      rep.saveDatabaseMetaJobEntryAttribute( id_job, getObjectId(), \"connection\", \"id_database\", connection );\n\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"schemaname\", schemaname );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"tablename\", tablename );\n      rep.saveJobEntryAttribute(\n        id_job, getObjectId(), \"success_condition\", getSuccessConditionCode( successCondition ) );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"rows_count_value\", rowsCountValue );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"custom_sql\", customSQL );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"is_custom_sql\", iscustomSQL );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"is_usevars\", isUseVars );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"add_rows_result\", isAddRowsResult );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"maximum_timeout\", maximumTimeout );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"check_cycle_time\", checkCycleTime );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"success_on_timeout\", successOnTimeout );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"clear_result_rows\", isClearResultList );\n\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException(\n        BaseMessages.getString( PKG, \"JobEntryWaitForSQL.UnableSaveRep\", \"\" + id_job ), dbe );\n    }\n  }\n\n  public void setDatabase( DatabaseMeta database ) {\n    this.connection = database;\n  }\n\n  public DatabaseMeta getDatabase() {\n    return connection;\n  }\n\n  @Override\n  public boolean evaluates() {\n    return true;\n  }\n\n  @Override","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/waitforsql/JobEntryWaitForSQL.java#L297-L333","documentation":"KettleException thrown by JobEntryWaitForSQL.saveRep when saving the job entry's attributes to the repository fails with a KettleDatabaseException. The original DB error is wrapped and the job id included. It means changes to this 'Wait for SQL' entry were not persisted.","triggerScenarios":"Calling saveRep while the repository database is unavailable, read-only, out of space, or when an attribute value violates a DB constraint (e.g. value too large for column).","commonSituations":"Saving a job to a repository with a dead connection; schema/attribute length mismatches after a Pentaho upgrade; repository in read-only maintenance mode.","solutions":["Check repository DB connectivity and write permissions","Inspect the wrapped KettleDatabaseException cause for constraint/space errors","Verify attribute values (custom SQL, timeouts) fit the repository column sizes","Retry the save after fixing the repository connection"],"exampleFix":"// before\njobEntry.saveRep(rep, metaStore, idJob); // throws\n// after\ntry {\n  jobEntry.saveRep(rep, metaStore, idJob);\n} catch (KettleException e) {\n  logError(\"Failed saving Wait For SQL entry: \" + e.getCause(), e);\n}","handlingStrategy":"try-catch","validationCode":"// before saveRep\nif (rep == null || idJob == null) throw new IllegalArgumentException(\"repository and id_job required\");\n// ensure custom SQL and timeout values are non-null and within expected sizes","typeGuard":null,"tryCatchPattern":"try {\n  entry.saveRep(rep, metaStore, idJob);\n} catch (KettleException e) {\n  logError(\"SaveRep failed: \" + e.getCause(), e);\n  // notify user the change was not persisted\n}","preventionTips":["Verify repository write access before batch saves","Keep attribute values within repository column limits","Test repository connectivity before long editing sessions","Upgrade repository schema when upgrading Pentaho"],"tags":["kettle","repository","database","save"],"backgroundTag":"database-write-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"}