{"record":{"id":"6966db564e6b1781","repo":"pentaho/pentaho-kettle","slug":"database-exception-unabletosetsavepointname","errorCode":null,"errorMessage":"Database.Exception.UnableToSetSavepointName","messagePattern":"Database\\.Exception\\.UnableToSetSavepointName","errorType":"exception","errorClass":"KettleDatabaseException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/database/Database.java","lineNumber":5097,"sourceCode":"      throw new KettleDatabaseException( e );\n    }\n    return ins.toString();\n  }\n\n  public Savepoint setSavepoint() throws KettleDatabaseException {\n    try {\n      return connection.setSavepoint();\n    } catch ( SQLException e ) {\n      throw new KettleDatabaseException(\n        BaseMessages.getString( PKG, \"Database.Exception.UnableToSetSavepoint\" ), e );\n    }\n  }\n\n  public Savepoint setSavepoint( String savePointName ) throws KettleDatabaseException {\n    try {\n      return connection.setSavepoint( savePointName );\n    } catch ( SQLException e ) {\n      throw new KettleDatabaseException( BaseMessages.getString(\n        PKG, \"Database.Exception.UnableToSetSavepointName\", savePointName ), e );\n    }\n  }\n\n  public void releaseSavepoint( Savepoint savepoint ) throws KettleDatabaseException {\n    try {\n      connection.releaseSavepoint( savepoint );\n    } catch ( SQLException e ) {\n      throw new KettleDatabaseException( BaseMessages.getString(\n        PKG, \"Database.Exception.UnableToReleaseSavepoint\" ), e );\n    }\n  }\n\n  public void rollback( Savepoint savepoint ) throws KettleDatabaseException {\n    try {\n      connection.rollback( savepoint );\n    } catch ( SQLException e ) {\n      throw new KettleDatabaseException( BaseMessages.getString(","sourceCodeStart":5079,"sourceCodeEnd":5115,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/database/Database.java#L5079-L5115","documentation":"Thrown by Database.setSavepoint(String savePointName) (Database.java:5097) when connection.setSavepoint(savePointName) fails with a SQLException. Same family as the unnamed variant, but with a named savepoint, so naming/identifier rules add extra failure modes.","triggerScenarios":"Calling Database.setSavepoint(name) with an invalid or too-long savepoint identifier, auto-commit enabled, closed connection, or a driver lacking savepoint support.","commonSituations":"Savepoint names exceeding DB identifier limits (e.g. 30 chars on Oracle); illegal characters in the savepoint name; auto-commit left on; duplicate savepoint name reuse on drivers that forbid it.","solutions":["Call setAutoCommit(false) before creating the savepoint","Shorten/quote the savepoint name to satisfy DB identifier rules","Check supportsSavepoints() on the DatabaseMeta before using named savepoints","Verify the connection is still open; reconnect if it was dropped","Read the wrapped SQLException for the driver-specific cause"],"exampleFix":"// before\nSavepoint sp = database.setSavepoint( \"my_very_long_savepoint_name_for_step\" );\n// after\nString name = \"sp_\" + UUID.randomUUID().toString().replace( \"-\", \"\" ).substring( 0, 20 );\ndatabase.setAutoCommit( false );\nSavepoint sp = database.setSavepoint( name );","handlingStrategy":"validation","validationCode":"if ( savePointName == null || savePointName.length() > 30 ) {\n  savePointName = \"sp\" + System.nanoTime();\n}\ndatabase.setAutoCommit( false );","typeGuard":null,"tryCatchPattern":"try {\n  savepoint = database.setSavepoint( savePointName );\n} catch ( KettleDatabaseException e ) {\n  SQLException cause = (SQLException) e.getCause();\n  log.error( \"Named savepoint [\" + savePointName + \"] failed: \" + cause.getMessage(), cause );\n  throw e;\n}","preventionTips":["Keep savepoint names short and identifier-safe","Disable auto-commit before named savepoints","Verify supportsSavepoints() on the target dialect","Generate unique names per savepoint creation"],"tags":["jdbc","database","transaction","savepoint"],"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"}