{"record":{"id":"5192157406a16b72","repo":"pentaho/pentaho-kettle","slug":"unable-to-save-notepad-in-repository-id-transformation-id","errorCode":null,"errorMessage":"Unable to save notepad in repository (id_transformation=id_transformation)","messagePattern":"Unable to save notepad in repository \\(id_transformation=id_transformation\\)","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryNotePadDelegate.java","lineNumber":122,"sourceCode":"   * @param rep\n   * @param id_transformation\n   * @throws KettleException\n   */\n  public void saveNotePadMeta( NotePadMeta note, ObjectId id_transformation ) throws KettleException {\n    try {\n      Point location = note.getLocation();\n      int x = location == null ? -1 : location.x;\n      int y = location == null ? -1 : location.y;\n\n      // Insert new Note in repository\n      note.setObjectId( insertNote(\n        note.getNote(), x, y, note.getWidth(), note.getHeight(), note.getFontName(), note.getFontSize(), note\n          .isFontBold(), note.isFontItalic(), note.getFontColorRed(), note.getFontColorGreen(), note\n          .getFontColorBlue(), note.getBackGroundColorRed(), note.getBackGroundColorGreen(), note\n          .getBackGroundColorBlue(), note.getBorderColorRed(), note.getBorderColorGreen(), note\n          .getBorderColorBlue(), note.isDrawShadow() ) );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( \"Unable to save notepad in repository (id_transformation=\"\n        + id_transformation + \")\", dbe );\n    }\n  }\n\n  //CHECKSTYLE:LineLength:OFF\n  public synchronized ObjectId insertNote( String note, long gui_location_x, long gui_location_y,\n    long gui_location_width, long gui_location_height, String fontname, long fontsize, boolean fontbold,\n    boolean fontitalic, long fontcolorred, long fontcolorgreen, long fontcolorblue, long fontbackcolorred,\n    long fontbackcolorgreen, long fontbackcolorblue, long fontbordercolorred, long fontbordercolorgreen,\n    long fontbordercolorblue, boolean drawshadow ) throws KettleException {\n    ObjectId id = repository.connectionDelegate.getNextNoteID();\n\n    RowMetaAndData table = new RowMetaAndData();\n\n    table.addValue( new ValueMetaInteger( KettleDatabaseRepository.FIELD_NOTE_ID_NOTE ), id );\n    table.addValue( new ValueMetaString( KettleDatabaseRepository.FIELD_NOTE_VALUE_STR ), note );\n    table.addValue( new ValueMetaInteger( KettleDatabaseRepository.FIELD_NOTE_GUI_LOCATION_X ), new Long( gui_location_x ) );\n    table.addValue( new ValueMetaInteger( KettleDatabaseRepository.FIELD_NOTE_GUI_LOCATION_Y ), new Long( gui_location_y ) );","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryNotePadDelegate.java#L104-L140","documentation":"saveNotePadMeta throws this KettleException when the UPDATE/INSERT of a note pad row into R_NOTE fails with a KettleDatabaseException. The id_transformation is included to help locate which transformation's note failed to persist.","triggerScenarios":"Calling saveNotePadMeta(notePadMeta, id_transformation) when the JDBC write fails: connection loss, R_NOTE column constraints violated (e.g. note text too long), read-only database, or schema drift.","commonSituations":"Very large note text exceeding column size; DB in read-only mode; network interruption during save; repository upgraded by another client mid-edit.","solutions":["Check the chained KettleDatabaseException cause for the exact SQL error","Shorten the note text / ensure it fits the R_NOTE column limits","Verify DB connectivity and write permissions on R_NOTE","Re-save the whole transformation after the database issue is resolved"],"exampleFix":"// before\nnotePad.setNote(veryLongText);\ndelegate.saveNotePadMeta(notePad, transId);\n// after\nif (veryLongText.length() > MAX_NOTE_LENGTH) { veryLongText = veryLongText.substring(0, MAX_NOTE_LENGTH); }\nnotePad.setNote(veryLongText);\ntry { delegate.saveNotePadMeta(notePad, transId); }\ncatch (KettleException e) { log.error(\"Save failed: \" + e.getCause(), e); throw e; }","handlingStrategy":"validation","validationCode":"if (note.getNote() != null && note.getNote().length() > 2000) { /* truncate before save */ note.setNote(note.getNote().substring(0, 2000)); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep note text within R_NOTE column limits","Verify DB write permissions for the repository user","Save the note as part of the transformation save flow so failures roll back together","Check the chained KettleDatabaseException cause when this fires"],"tags":["database","repository","notepad","write-failed"],"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"}