dbeaver/dbeaver · error · DBDatabaseException

Can't read tablespace statistics

Error message

Can't read tablespace statistics

What it means

AltibaseDataSource.refreshTablespaceStatistics wraps any DBException raised while iterating and loading sizes of each AltibaseTablespace into DBDatabaseException('Can't read tablespace statistics'). The finally block still sets hasStatistics=true, so a later non-forced refresh returns early without retrying.

Source

Thrown at plugins/org.jkiss.dbeaver.ext.altibase/src/org/jkiss/dbeaver/ext/altibase/model/AltibaseDataSource.java:690

    void resetStatistics() {
        hasStatistics = false;
    }

    @Override
    public void collectObjectStatistics(@NotNull DBRProgressMonitor monitor, boolean totalSizeOnly, boolean forceRefresh) throws DBException {
        if (hasStatistics && !forceRefresh) {
            return;
        }

        try {
            for (AltibaseTablespace tbs : tablespaceCache.getAllObjects(monitor, AltibaseDataSource.this)) {
                AltibaseTablespace tablespace = tablespaceCache.getObject(monitor, AltibaseDataSource.this, tbs.getName());
                if (tablespace != null) {
                    tablespace.loadSizes(monitor);
                }
            }
        } catch (DBException e) {
            throw new DBDatabaseException("Can't read tablespace statistics", e, getDataSource());
        } finally {
            hasStatistics = true;
        }
    }

    ///////////////////////////////////////////////
    // Altibase Properties
    @NotNull
    public List<AltibaseProperty> getProperties(DBRProgressMonitor monitor)
            throws DBException {
        return loadPropertyList(monitor);
    }

    @NotNull
    private List<AltibaseProperty> loadPropertyList(@NotNull DBRProgressMonitor monitor) throws DBException {
        try (JDBCSession session = DBUtils.openMetaSession(monitor, this, "Load properties")) {
            try (JDBCPreparedStatement dbStat = session.prepareStatement("SELECT * FROM V$PROPERTY ORDER BY NAME ASC")) {
                try (JDBCResultSet dbResult = dbStat.executeQuery()) {

View on GitHub (pinned to 1e5ee1042b)

Solutions

  1. Connect with a user that has privileges to read Altibase tablespace sizing views.
  2. Force-refresh again after fixing privileges (hasStatistics is set true even on failure, so a force flag may be required).
  3. Check the wrapped DBException cause for the specific tablespace/object that failed and address it.

Example fix

// before
} catch (DBException e) {
    throw new DBDatabaseException("Can't read tablespace statistics", e, getDataSource());
} finally {
    hasStatistics = true;
}

// after - only mark statistics loaded on success so a retry is possible
} catch (DBException e) {
    throw new DBDatabaseException("Can't read tablespace statistics", e, getDataSource());
}
hasStatistics = true;
Defensive patterns

Strategy: try-catch

Try / catch

try {
    dataSource.refreshTablespaceStatistics(monitor, forceRefresh);
} catch (DBDatabaseException e) {
    // statistics partially unavailable; degrade gracefully, log the wrapped cause
    log.warn("Tablespace statistics unavailable", e);
}

Prevention

When it happens

Trigger: Forcing a metadata/statistics refresh when one tablespace's loadSizes(monitor) fails; iterating tablespaceCache.getAllObjects raises DBException (privilege, missing system view, stale cache).

Common situations: Connected user lacks SELECT on the tablespace system views; Altibase version exposes different sizing columns; a tablespace is in an inconsistent state; cache was partially populated.

Related errors


AI-assisted analysis of dbeaver/dbeaver@1e5ee1042b (2026-08-13). Data as JSON: /api/errors/94b028648f989356. Report an issue: GitHub.