pentaho/pentaho-kettle · error · KettleDatabaseException

Database.Exception.UnableToSetSavepoint

Error message

Database.Exception.UnableToSetSavepoint

What it means

Thrown by Database.setSavepoint() (Database.java:5088) when connection.setSavepoint() fails with a SQLException. JDBC savepoints require an active transaction with auto-commit disabled, and not all drivers support them.

Solutions

  1. Call Database.setAutoCommit(false) before requesting a savepoint
  2. Verify the connection is open and valid (checkDatabaseException/connected state)
  3. Confirm the target database and driver support savepoints (JDBC 3.0+, transactional tables)
  4. Check supportsSavepoints() on the DatabaseMeta before using savepoint logic
  5. Inspect the wrapped SQLException cause for feature-not-supported vs connection errors

Example fix

// before
Savepoint sp = database.setSavepoint();
// after
if ( database.getDatabaseMeta().supportsSavepoints() ) {
  database.setAutoCommit( false );
  Savepoint sp = database.setSavepoint();
}
Defensive patterns

Strategy: validation

Validate before calling

if ( !databaseMeta.supportsSavepoints() ) {
  throw new IllegalStateException( "Savepoints not supported by " + databaseMeta.getPluginName() );
}
database.setAutoCommit( false );

Try / catch

try {
  savepoint = database.setSavepoint();
} catch ( KettleDatabaseException e ) {
  SQLException sqle = (SQLException) e.getCause();
  if ( sqle instanceof SQLFeatureNotSupportedException ) {
    // fall back to full transaction without savepoints
  } else {
    throw e;
  }
}

Prevention

When it happens

Trigger: Calling Database.setSavepoint() while autoCommit is still true, the connection is closed, or the JDBC driver does not support savepoints (throws SQLFeatureNotSupportedException).

Common situations: Forgetting setAutoCommit(false) before setSavepoint; using drivers/databases without savepoint support (e.g. older MySQL/MyISAM tables); calling savepoint APIs after the connection has been dropped.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/21c8af8867176463. Report an issue: GitHub.

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/database/Database.java:5088

              break;
            default:
              ins.append( fields.getString( r, i ) );
              break;
          }
        }
      }
      ins.append( ')' );
    } catch ( Exception e ) {
      throw new KettleDatabaseException( e );
    }
    return ins.toString();
  }

  public Savepoint setSavepoint() throws KettleDatabaseException {
    try {
      return connection.setSavepoint();
    } catch ( SQLException e ) {
      throw new KettleDatabaseException(
        BaseMessages.getString( PKG, "Database.Exception.UnableToSetSavepoint" ), e );
    }
  }

  public Savepoint setSavepoint( String savePointName ) throws KettleDatabaseException {
    try {
      return connection.setSavepoint( savePointName );
    } catch ( SQLException e ) {
      throw new KettleDatabaseException( BaseMessages.getString(
        PKG, "Database.Exception.UnableToSetSavepointName", savePointName ), e );
    }
  }

  public void releaseSavepoint( Savepoint savepoint ) throws KettleDatabaseException {
    try {
      connection.releaseSavepoint( savepoint );
    } catch ( SQLException e ) {
      throw new KettleDatabaseException( BaseMessages.getString(

View on GitHub (pinned to f3058517a1)