{"record":{"id":"9441807fe8020e7f","repo":"pentaho/pentaho-kettle","slug":"terafastmeta-exception-connectionnotdefined","errorCode":"TeraFastMeta.Exception.ConnectionNotDefined","errorMessage":"TeraFastMeta.Exception.ConnectionNotDefined","messagePattern":"TeraFastMeta\\.Exception\\.ConnectionNotDefined","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/terafast-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/terafastbulkloader/TeraFastMeta.java","lineNumber":241,"sourceCode":"      remarks.add( checkResult );\n    } catch ( KettleException e ) {\n      checkResult = new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR, e.getMessage(), stepMeta );\n      remarks.add( checkResult );\n    }\n  }\n\n  /**\n   * @return the database.\n   * @throws KettleException\n   *           if an error occurs.\n   */\n  public Database connectToDatabase() throws KettleException {\n    if ( this.getDbMeta() != null ) {\n      Database db = new Database( loggingObject, this.getDbMeta() );\n      db.connect();\n      return db;\n    }\n    throw new KettleException( MESSAGES.getString( \"TeraFastMeta.Exception.ConnectionNotDefined\" ) );\n  }\n\n  /**\n   * {@inheritDoc}\n   *\n   * @see org.pentaho.di.trans.step.StepMetaInterface#getStep(org.pentaho.di.trans.step.StepMeta,\n   *      org.pentaho.di.trans.step.StepDataInterface, int, org.pentaho.di.trans.TransMeta, org.pentaho.di.trans.Trans)\n   */\n  public StepInterface getStep( final StepMeta stepMeta, final StepDataInterface stepDataInterface, final int cnr,\n    final TransMeta transMeta, final Trans disp ) {\n    return new TeraFast( stepMeta, stepDataInterface, cnr, transMeta, disp );\n  }\n\n  /**\n   * {@inheritDoc}\n   *\n   * @see org.pentaho.di.trans.step.StepMetaInterface#getStepData()\n   */","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/terafast-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/terafastbulkloader/TeraFastMeta.java#L223-L259","documentation":"TeraFastMeta.connectToDatabase() throws this localized error when the step's database connection metadata (dbMeta) is null — there is no configured database connection, so no Database object can be created or connected.","triggerScenarios":"connectToDatabase() is called (e.g. via database()/getRequiredFields during preview or tableFields) while the step has no database connection selected in its configuration.","commonSituations":"User forgot to pick a connection in the TeraFast bulk loader dialog; transformation loaded from XML/repository where the connection reference was dropped; connection was deleted from the repository after the step referenced it.","solutions":["Open the TeraFast step dialog and select/define a database connection","Verify the connection still exists in the transformation's connection list","Re-save the transformation so the connection reference is persisted","Check that shared/central connections were imported when moving transformations between environments"],"exampleFix":"// before\nDatabase db = stepMeta.getTeraFastMeta().connectToDatabase();\n// after\nif ( stepMeta.getTeraFastMeta().getDbMeta() == null ) {\n  throw new KettleException( \"Select a database connection on the TeraFast step before previewing\" );\n}\nDatabase db = stepMeta.getTeraFastMeta().connectToDatabase();","handlingStrategy":"validation","validationCode":"if ( teraFastMeta.getDbMeta() == null ) {\n  throw new KettleException( \"TeraFast step has no database connection configured\" );\n}","typeGuard":"boolean hasConnection( TeraFastMeta m ) {\n  return m != null && m.getDbMeta() != null && m.getDbMeta().getName() != null;\n}","tryCatchPattern":null,"preventionTips":["Always select a database connection in the TeraFast step dialog before saving","When generating transformations programmatically, call meta.setDbMeta( databaseMeta ) explicitly","Check that referenced shared connections exist when moving between environments","Validate the transformation with the Kettle metadata verification before execution"],"tags":["kettle","teradata","missing-connection","configuration","metadata"],"backgroundTag":"missing-required-config-field","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"}