mattcasters opened a new pull request, #8376:
URL: https://github.com/apache/hop/pull/8376
### Description
Fixes #8375
Whenever trying to connect to a database or executing queries from an open
SQL Editor tab, Hop now implicitly performs a fast, lightweight metadata reload:
1. Verifies that the connection still exists in the metadata store
(`IHopMetadataSerializer<DatabaseMeta>.exists(...)`). If it does not, removes
the connection from the tree and aborts the connection/execution.
2. Loads the latest metadata from the Hop GUI multi-metadata provider
(`IHopMetadataSerializer<DatabaseMeta>.load(...)`).
3. Connects or executes queries using the fresh configuration.
### Changes
- **DatabaseWorkbench**:
- Added `reloadConnectionMeta(String connectionName)` which checks
existence, removes deleted connections from the workbench tree, loads fresh
`DatabaseMeta`, and updates `connections` state.
- Updated `connect(...)`, `ensureConnection(...)`, `openSqlEditor()`,
`generateDdl()`, `previewTable()`, and `showTableInfo()` to reload metadata
prior to connecting.
- Synchronizes open `DatabaseSqlEditorTab` and `DatabaseTableInfoTab`
instances with the fresh metadata via `updateTabsDatabaseMeta(...)`.
- **DatabaseSqlEditorTab**:
- Made `databaseMeta` non-final with `@Getter @Setter`.
- In `executeScript(...)`, reloads metadata before execution. If the
connection no longer exists, shows an error dialog and aborts execution.
- **DatabaseTableInfoTab**:
- Made `databaseMeta` non-final with `@Getter @Setter`.
- In `loadDetails()`, reloads metadata before establishing the connection.
- **messages_en_US.properties**:
- Added `DatabasePerspective.Error.ConnectionNotFound` message.
- **Unit Tests**:
- Added `DatabaseWorkbenchReloadMetaTest` verifying existence checks,
deletion cleanup, and tab metadata synchronization.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]