pentaho/pentaho-kettle · error · UnsupportedOperationException

The invalidateNamedDataSource method was not implemented…

Error message

The invalidateNamedDataSource method was not implemented yet.

What it means

invalidateNamedDataSource is a default method on DataSourceProviderInterface whose default body throws UnsupportedOperationException stating it was not implemented yet. Providers must override it to support invalidating (closing/refreshing) named data sources. getPoolingDataSource in Database.java calls it.

Solutions

  1. Override invalidateNamedDataSource in your DataSourceProviderInterface implementation
  2. Avoid the pooling code path (disable connection pool on the DatabaseMeta) if invalidation is not needed
  3. Catch UnsupportedOperationException and treat invalidation as a no-op if acceptable

Example fix

// before
public DataSource invalidateNamedDataSource( String name, DatasourceType type ) {
  throw new UnsupportedOperationException( "not implemented" );
}

// after
@Override
public DataSource invalidateNamedDataSource( String name, DatasourceType type ) {
  pool.evict( name );
  return pool.refresh( name );
}
Defensive patterns

Strategy: try-catch

Validate before calling

if ( !dbMeta.isUsingConnectionPool() ) {
  // skip code path that calls invalidateNamedDataSource
}

Type guard

boolean supportsInvalidate = !DataSourceProviderInterface.class.equals(
  dsp.getClass().getMethod( "invalidateNamedDataSource", String.class, DatasourceType.class ).getDeclaringClass() );

Try / catch

try {
  dsp.invalidateNamedDataSource( name, type );
} catch ( UnsupportedOperationException e ) {
  log.warn( "Provider does not support invalidation; skipping" );
}

Prevention

When it happens

Trigger: Calling invalidateNamedDataSource(datasourceName, type) directly, or indirectly through Database.getPoolingDataSource, when the DataSourceProviderInterface implementation has not overridden the method.

Common situations: Using pooled database connections with a minimal custom data source provider; library upgrade added the interface method but the provider was never updated to implement it.

Related errors


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

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/database/DataSourceProviderInterface.java:66

   * @param dbMeta  definition of the datasource provided via DatabaseMeta
   * @param type    data source's type
   * @return named data source
   * @throws DataSourceNamingException
   */
  default DataSource getPooledDataSourceFromMeta( DatabaseMeta dbMeta, DatasourceType type ) throws DataSourceNamingException {
    throw new UnsupportedOperationException( "getNamedDataSourceFromMeta is not supported" );
  }

  /**
   * Invalidate the named data source of respecting its <code>type</code>
   *
   * @param datasourceName name of the desired data source
   * @param type           data source's type
   * @return named data source
   * @throws DataSourceNamingException
   */
  default DataSource invalidateNamedDataSource( String datasourceName, DatasourceType type ) throws DataSourceNamingException {
    throw new UnsupportedOperationException( "The invalidateNamedDataSource method was not implemented yet." );
  }

  enum DatasourceType {
    JNDI, POOLED
  }
}

View on GitHub (pinned to f3058517a1)