{"record":{"id":"e3048ff2af58aca2","repo":"pentaho/pentaho-kettle","slug":"synchronizeaftermergemeta-exception-connectionnotdefined","errorCode":null,"errorMessage":"SynchronizeAfterMergeMeta.Exception.ConnectionNotDefined","messagePattern":"SynchronizeAfterMergeMeta\\.Exception\\.ConnectionNotDefined","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/synchronizeaftermerge/SynchronizeAfterMergeMeta.java","lineNumber":1061,"sourceCode":"          // Check if this table exists...\n          if ( db.checkTableExists( realSchemaName, realTableName ) ) {\n            return db.getTableFieldsMeta( realSchemaName, realTableName );\n          } else {\n            throw new KettleException( BaseMessages.getString(\n              PKG, \"SynchronizeAfterMergeMeta.Exception.TableNotFound\" ) );\n          }\n        } else {\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"SynchronizeAfterMergeMeta.Exception.TableNotSpecified\" ) );\n        }\n      } catch ( Exception e ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"SynchronizeAfterMergeMeta.Exception.ErrorGettingFields\" ), e );\n      } finally {\n        db.close();\n      }\n    } else {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"SynchronizeAfterMergeMeta.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;","sourceCodeStart":1043,"sourceCodeEnd":1079,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/synchronizeaftermerge/SynchronizeAfterMergeMeta.java#L1043-L1079","documentation":"Repository-loading guard in SynchronizeAfterMergeMeta: while getting the table fields, the flow reached a state where no database connection was defined (the connection lookup produced null), so the step cannot query the target table's schema. It is the outer catch re-raising the missing-connection condition with a localized message.","triggerScenarios":"Calling getTableFieldsMeta() on a step whose database connection field was never set, or the connection was deleted from the transformation after the step referenced it.","commonSituations":"Copying steps between transformations where the shared connection wasn't carried over; repository connection deleted; XML import omitted <connection> element; user skipped selecting a connection in the dialog.","solutions":["Select a database connection in the Synchronize After Merge step dialog","Ensure the transformation contains the referenced connection and it is named correctly","Fix the XML/repository entry so the step's connection reference points to an existing DatabaseMeta","Validate the transformation with TransMeta before executing"],"exampleFix":"// before\nstepMeta.setDatabaseMeta(null);\n// after\nstepMeta.setDatabase(transMeta.findDatabaseConnection(\"DB_CONN\")); // must exist","handlingStrategy":"validation","validationCode":"if (meta.getDatabaseMeta() == null) { throw new IllegalArgumentException(\"Synchronize After Merge: database connection not defined\"); }","typeGuard":null,"tryCatchPattern":"try { meta.getTableFieldsMeta(...); } catch (KettleException e) { logError(\"No connection defined: \" + e.getMessage()); }","preventionTips":["Always assign a connection in the step dialog","Check transformations after copy/paste of steps for dangling connection references","Verify the connection name survives XML export/import"],"tags":["kettle","database","connection","configuration"],"backgroundTag":"missing-required-config","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"}