This is slightly linked #1741. 

In 
https://github.com/liquibase/liquibase/blob/10a0c509c59401e9351cf7d134b4bc671b5d500f/liquibase-core/src/main/java/liquibase/hub/HubUpdater.java#L364-L383

The currently held lock is released and then reacquired again. However, when using Liquibase programatically as a library the prompt is always disabled and therefore releasing and then acquiring the lock is entirely not needed.

Can I propose a change that will do

```
if (!Scope.getCurrentScope().getUI().getAllowPrompt()) {
    return;
}
```

This will solve the problem with the polluting of the logging with "Skipping auto-registration" since registering is anyways not possible when using it as a library.



┆Issue is synchronized with this [Jira Story](https://datical.atlassian.net/browse/LB-1748) by [Unito](https://www.unito.io)

private void loadDatabaseMetadata() throws DatabaseException, SQLException {
        if (database.getConnection() == null) {
            return;
        }
        final IntegrationDetails integrationDetails = Scope.getCurrentScope().get("integrationDetails", IntegrationDetails.class);
        if (integrationDetails == null) {
            return;
        }
        String databaseProductName = database.getDatabaseProductName();
        String databaseProductVersion = database.getDatabaseProductVersion();
        Scope.getCurrentScope().getLog(getClass()).fine("Database product name         " + databaseProductName);
        Scope.getCurrentScope().getLog(getClass()).fine("Database product version      " + databaseProductVersion);
        DatabaseConnection connection = database.getConnection();
        if (connection instanceof JdbcConnection) {
            JdbcConnection jdbcConnection = (JdbcConnection) connection;
            java.sql.Connection conn = jdbcConnection.getUnderlyingConnection();
            int driverMajorVersion = conn.getMetaData().getDriverMajorVersion();
            int driverMinorVersion = conn.getMetaData().getDriverMinorVersion();
            Scope.getCurrentScope().getLog(getClass()).fine("Database driver version       " +
                    driverMajorVersion + "." + driverMinorVersion);
            integrationDetails.setParameter("db__driverVersion", driverMajorVersion + "." + driverMinorVersion);
        } else {
            integrationDetails.setParameter("db__driverVersion", "Unable to determine");
        }
        integrationDetails.setParameter("db__databaseProduct", databaseProductName);
        integrationDetails.setParameter("db__databaseVersion", databaseProductVersion);
    }
}