{"record":{"id":"42c892f9e292b50e","repo":"pentaho/pentaho-kettle","slug":"error-0003-cannot-save-job-entry-jobentrycheckdbconnections","errorCode":"ERROR_0003_Cannot_Save_Job_Entry","errorMessage":"JobEntryCheckDbConnections.ERROR_0003_Cannot_Save_Job_Entry","messagePattern":"JobEntryCheckDbConnections\\.ERROR_0003_Cannot_Save_Job_Entry","errorType":"error_code","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/job/entries/checkdbconnection/JobEntryCheckDbConnections.java","lineNumber":265,"sourceCode":"        PKG, \"JobEntryCheckDbConnections.ERROR_0002_Cannot_Load_Job_From_Repository\", \"\" + id_jobentry, dbe\n          .getMessage() ) );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ) throws KettleException {\n    try {\n      // save the arguments...\n      if ( connections != null ) {\n        for ( int i = 0; i < connections.length; i++ ) {\n          rep.saveDatabaseMetaJobEntryAttribute(\n            id_job, getObjectId(), i, \"connection\", \"id_database\", connections[i] );\n\n          rep.saveJobEntryAttribute( id_job, getObjectId(), i, \"waittime\", getWaitTimeCode( waittimes[i] ) );\n          rep.saveJobEntryAttribute( id_job, getObjectId(), i, \"waitfor\", waitfors[i] );\n        }\n      }\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"JobEntryCheckDbConnections.ERROR_0003_Cannot_Save_Job_Entry\", \"\" + id_job, dbe.getMessage() ) );\n    }\n  }\n\n  public Result execute( Result previousResult, int nr ) {\n    Result result = previousResult;\n    result.setResult( true );\n    int nrerrors = 0;\n    int nrsuccess = 0;\n\n    if ( connections != null ) {\n      for ( int i = 0; i < connections.length && !parentJob.isStopped(); i++ ) {\n        Database db = new Database( this, connections[i] );\n        db.shareVariablesWith( this );\n        try {\n          db.connect( parentJob.getTransactionId(), null );\n\n          if ( isDetailed() ) {","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/job/entries/checkdbconnection/JobEntryCheckDbConnections.java#L247-L283","documentation":"saveRep throws KettleException with ERROR_0003 when persisting the CheckDbConnections entry's connection/wait attributes to the repository fails with a KettleDatabaseException. The job id and DB error message are included for diagnosis.","triggerScenarios":"rep.saveJobEntryAttribute for connection/waittime/waitfor failing due to DB outage, constraint violation, insufficient privileges, or null waitfors[i] on a NOT NULL column.","commonSituations":"Repository database locked or offline during save, quota/disk issues, DB user lacking write grants, concurrent edits causing lock contention.","solutions":["Read the wrapped KettleDatabaseException message to identify the SQL error and fix the repository DB condition (connectivity, locks, disk).","Grant the repository user INSERT/UPDATE privileges on R_JOBENTRY_ATTRIBUTE.","Null-check waitfors/waittimes entries before saving and substitute safe defaults.","Retry the save after the repository connection is restored."],"exampleFix":"// before\nrep.saveJobEntryAttribute( id_job, getObjectId(), i, \"waitfor\", waitfors[i] );\n// after\nrep.saveJobEntryAttribute( id_job, getObjectId(), i, \"waitfor\", Const.NVL( waitfors[i], \"\" ) );","handlingStrategy":"try-catch","validationCode":"// null-guard arrays before save\nif ( waitfors == null || waittimes == null || connections == null ) throw new IllegalStateException( \"uninitialized check-db-connections arrays\" );","typeGuard":null,"tryCatchPattern":"try { entry.saveRep( rep, metaStore, id_job ); } catch ( KettleException e ) { logError( \"ERROR_0003 for \" + id_job + \": \" + e.getMessage(), e ); /* inspect KettleDatabaseException cause */ }","preventionTips":["Initialize waitfors/waittimes defaults in the entry constructor.","Verify repository write privileges before bulk saves.","Retry saves after transient DB outages rather than discarding the job."],"tags":["repository","database","write-failed","persistence"],"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"}