apache/seatunnel · error · SeaTunnelException

Error reading oracle variables: ${e.getMessage()}

Error message

Error reading oracle variables: ${e.getMessage()}

What it means

OracleDialect.isDataCollectionIdCaseSensitive opens a JDBC connection to check whether the Oracle server is version 11 (which is case-sensitive for identifiers). If opening the connection or querying the Oracle version throws a SQLException, it is wrapped in a SeaTunnelException with this message, keeping the original cause.

Source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/oracle/source/OracleDialect.java:78

            OracleSourceConfigFactory configFactory, List<CatalogTable> catalogTables) {
        this.configFactory = configFactory;
        this.sourceConfig = configFactory.create(0);
        this.tableMap = CatalogTableUtils.convertTables(catalogTables);
    }

    @Override
    public String getName() {
        return "Oracle";
    }

    @SuppressWarnings("checkstyle:MagicNumber")
    @Override
    public boolean isDataCollectionIdCaseSensitive(JdbcSourceConfig sourceConfig) {
        try (JdbcConnection jdbcConnection = openJdbcConnection(sourceConfig)) {
            OracleConnection oracleConnection = (OracleConnection) jdbcConnection;
            return oracleConnection.getOracleVersion().getMajor() == 11;
        } catch (SQLException e) {
            throw new SeaTunnelException("Error reading oracle variables: " + e.getMessage(), e);
        }
    }

    @Override
    public JdbcConnection openJdbcConnection(JdbcSourceConfig sourceConfig) {
        return createOracleConnection(sourceConfig.getDbzConnectorConfig().getJdbcConfig());
    }

    @Override
    public ChunkSplitter createChunkSplitter(JdbcSourceConfig sourceConfig) {
        return new OracleChunkSplitter(sourceConfig, this);
    }

    @Override
    public List<TableId> discoverDataCollections(JdbcSourceConfig sourceConfig) {
        OracleSourceConfig oracleSourceConfig = (OracleSourceConfig) sourceConfig;
        String database = oracleSourceConfig.getDbzConnectorConfig().getDatabaseName();

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check the root cause (the chained SQLException, e.g. 'Connection refused' or ORA- code) and fix connectivity or credentials in the source config.
  2. Verify the Oracle listener is up: tnsping / test the URL host:port/service_name.
  3. Confirm the ojdbc driver jar exists in the connector/plugin lib directory.
  4. Retry after network/DBA fixes; the error itself is not retryable programmatically.

Example fix

// before (connection fails)
url = "jdbc:oracle:thin:@//wrong-host:1521/ORCL"
// after
url = "jdbc:oracle:thin:@//db-host:1521/ORCLPDB1"
username = "dbzuser"
password = "***"
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-flight connectivity check
try (java.sql.Connection c = java.sql.DriverManager.getConnection(url, user, pass)) {
    c.createStatement().execute("SELECT 1 FROM DUAL");
}

Try / catch

try {
    sourceFactory.create();
} catch (org.apache.seatunnel.common.exception.SeaTunnelException e) {
    if (e.getCause() instanceof java.sql.SQLException) {
        java.sql.SQLException sql = (java.sql.SQLException) e.getCause();
        // inspect vendorCode/message (ORA-01017, IO Error: Connection refused) and fix config
    }
    throw e;
}

Prevention

When it happens

Trigger: openJdbcConnection(sourceConfig) fails — bad host/port/service name, wrong credentials, network/firewall drop, driver missing — or OracleConnection.getOracleVersion() raises SQLException during the version probe.

Common situations: Database unreachable (listener down, VPN/security group blocks 1521), ORA-01017 invalid username/password, wrong database-list vs service name, or the Oracle JDBC driver being absent from the plugin directory.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/a8c69cd00ad3adc6. Report an issue: GitHub.