src/main/java/software/aws/neptune/gremlin/GremlinQueryExecutor.java [303:323]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        final String endpoint = this.gremlinConnectionProperties.getContactPoint();
        if (!MetadataCache.isMetadataCached(endpoint)) {
            // TODO AN-576: Temp isValid check. Find a better solution inside the export tool to check if connection is valid.
            if (!statement.getConnection().isValid(3000)) {
                throw new SQLException("Failed to execute getTables, could not connect to database.");
            }
        }
        MetadataCache.updateCacheIfNotUpdated(gremlinConnectionProperties);
        return new GremlinResultSetGetTables(statement,
                MetadataCache.getFilteredCacheNodeColumnInfos(tableName, endpoint),
                MetadataCache.getFilteredResultSetInfoWithoutRowsForTables(tableName, endpoint));
    }

    /**
     * Function to get schema.
     *
     * @param statement java.sql.Statement Object required for result set.
     * @return java.sql.ResultSet Object containing schemas.
     * @throws SQLException if query execution fails, or it was cancelled.
     */
    @Override
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/main/java/software/aws/neptune/gremlin/sql/SqlGremlinQueryExecutor.java [134:154]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        final String endpoint = this.gremlinConnectionProperties.getContactPoint();
        if (!MetadataCache.isMetadataCached(endpoint)) {
            if (!statement.getConnection().isValid(3000)) {
                throw new SQLException("Failed to execute getTables, could not connect to database.");
            }
        }
        MetadataCache.updateCacheIfNotUpdated(gremlinConnectionProperties);
        return new GremlinResultSetGetTables(statement,
                MetadataCache.getFilteredCacheNodeColumnInfos(tableName, endpoint),
                MetadataCache.getFilteredResultSetInfoWithoutRowsForTables(tableName, endpoint));
    }

    /**
     * Function to execute query.
     *
     * @param sql       Query to execute.
     * @param statement java.sql.Statement Object required for result set.
     * @return java.sql.ResultSet object returned from query execution.
     * @throws SQLException if query execution fails, or it was cancelled.
     */
    @Override
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



