{"record":{"id":"b4e66bce7f027c22","repo":"pentaho/pentaho-kettle","slug":"orabulkloadermeta-exception-connectionnotdefined","errorCode":null,"errorMessage":"OraBulkLoaderMeta.Exception.ConnectionNotDefined","messagePattern":"OraBulkLoaderMeta\\.Exception\\.ConnectionNotDefined","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/oracle-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/orabulkloader/OraBulkLoaderMeta.java","lineNumber":888,"sourceCode":"          String schemaTable = databaseMeta.getQuotedSchemaTableCombination( realSchemaName, realTableName );\n\n          // Check if this table exists...\n          if ( db.checkTableExists( schemaTable ) ) {\n            return db.getTableFields( schemaTable );\n          } else {\n            throw new KettleException( BaseMessages.getString( PKG, \"OraBulkLoaderMeta.Exception.TableNotFound\" ) );\n          }\n        } else {\n          throw new KettleException( BaseMessages.getString( PKG, \"OraBulkLoaderMeta.Exception.TableNotSpecified\" ) );\n        }\n      } catch ( Exception e ) {\n        throw new KettleException(\n          BaseMessages.getString( PKG, \"OraBulkLoaderMeta.Exception.ErrorGettingFields\" ), e );\n      } finally {\n        db.close();\n      }\n    } else {\n      throw new KettleException( BaseMessages.getString( PKG, \"OraBulkLoaderMeta.Exception.ConnectionNotDefined\" ) );\n    }\n\n  }\n\n  /**\n   * @return the schemaName\n   */\n  public String getSchemaName() {\n    return schemaName;\n  }\n\n  /**\n   * @param schemaName\n   *          the schemaName to set\n   */\n  public void setSchemaName( String schemaName ) {\n    this.schemaName = schemaName;\n  }","sourceCodeStart":870,"sourceCodeEnd":906,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/oracle-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/orabulkloader/OraBulkLoaderMeta.java#L870-L906","documentation":"Thrown by OraBulkLoaderMeta.getTableFields() when the step's databaseMeta (database connection) is null. The method guards with if ( databaseMeta != null ); the else branch raises the ConnectionNotDefined KettleException from the messages bundle.","triggerScenarios":"getTableFields called before a connection has been assigned to the step metadata; the 'connection' attribute was lost when loading the transformation from XML/repository; programmatically building OraBulkLoaderMeta without setDatabaseMeta().","commonSituations":"Transformation XML edited or merged so the <connection> reference no longer matches a defined connection; repository import dropped the connection; new step created in code (e.g. via API/scripting) and connection never set; copying the step to a transformation whose shared connections were not saved.","solutions":["Open the OraBulkLoader step and select/define a database connection","Ensure the connection exists as a shared connection and is saved with the transformation","In code, call meta.setDatabaseMeta( dbMeta ) with a valid DatabaseMeta before using the step"],"exampleFix":"// before\nOraBulkLoaderMeta meta = new OraBulkLoaderMeta();\nmeta.getTableFields(...); // NPE-free but throws ConnectionNotDefined\n// after\nmeta.setDatabaseMeta( new DatabaseMeta( \"oracleConn\", \"Oracle\", \"Native\", \"user\", \"pass\", \"host\", \"ORCL\", \"1521\" ) );","handlingStrategy":"validation","validationCode":"if ( meta.getDatabaseMeta() == null ) {\n  throw new IllegalStateException( \"OraBulkLoader step has no database connection configured\" );\n}","typeGuard":null,"tryCatchPattern":"try { fields = meta.getTableFields(); } catch ( KettleException e ) { if ( meta.getDatabaseMeta() == null ) { throw new IllegalStateException( \"Set a DatabaseMeta on the step\", e ); } throw e; }","preventionTips":["Always setDatabaseMeta() when constructing step meta via API","Verify connections survive XML/repository round-trips after edits","Keep shared connections saved with the transformation"],"tags":["kettle","pdi","oracle","connection","missing-config"],"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"}