{"record":{"id":"b7f0889fdbb9ac68","repo":"apache/seatunnel","slug":"can-t-create-jdbcdialect-without-compatible-mode-f-b7f088","errorCode":null,"errorMessage":"Can't create JdbcDialect without compatible mode for OceanBase","messagePattern":"Can't create JdbcDialect without compatible mode for OceanBase","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/oceanbase/OceanBaseDialectFactory.java","lineNumber":43,"sourceCode":"import com.google.auto.service.AutoService;\n\nimport javax.annotation.Nonnull;\n\n@AutoService(JdbcDialectFactory.class)\npublic class OceanBaseDialectFactory implements JdbcDialectFactory {\n    @Override\n    public String dialectFactoryName() {\n        return DatabaseIdentifier.OCEANBASE;\n    }\n\n    @Override\n    public boolean acceptsURL(String url) {\n        return url.startsWith(\"jdbc:oceanbase:\");\n    }\n\n    @Override\n    public JdbcDialect create() {\n        throw new UnsupportedOperationException(\n                \"Can't create JdbcDialect without compatible mode for OceanBase\");\n    }\n\n    @Override\n    public JdbcDialect create(@Nonnull String compatibleMode, String fieldIde) {\n        if (\"oracle\".equalsIgnoreCase(compatibleMode)) {\n            return new OracleDialect();\n        }\n        return new OceanBaseMysqlDialect();\n    }\n}\n","sourceCodeStart":25,"sourceCodeEnd":55,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/oceanbase/OceanBaseDialectFactory.java#L25-L55","documentation":"OceanBaseDialectFactory cannot build a dialect without knowing OceanBase's compatibility mode (MySQL vs Oracle). The no-arg create() deliberately throws UnsupportedOperationException because the two modes need entirely different SQL dialects, so a mode must be supplied via create(compatibleMode, fieldIde).","triggerScenarios":"The JDBC URL is recognized as jdbc:oceanbase: but dialect resolution falls back to the parameterless factory create() because no compatible-mode config was provided.","commonSituations":"Using the OceanBase dialect with only a URL and no compatible_mode config key; calling the dialect factory programmatically without a mode; using an older config template predating OceanBase mode support.","solutions":["Set the OceanBase compatible mode in the source/sink config (e.g. compatible_mode = \"mysql\" or \"oracle\").","Use the dialect factory overload that takes compatibleMode explicitly.","Confirm the URL is jdbc:oceanbase: and mode matches the actual OceanBase tenant (MySQL or Oracle mode)."],"exampleFix":"// before\nurl = \"jdbc:oceanbase://host:2881/db\"\n// after\nurl = \"jdbc:oceanbase://host:2881/db\"\ncompatible_mode = \"mysql\"","handlingStrategy":"validation","validationCode":"if (url.startsWith(\"jdbc:oceanbase:\") && (compatibleMode == null || compatibleMode.isEmpty())) {\n    throw new IllegalArgumentException(\"OceanBase requires compatible_mode = mysql|oracle\");\n}","typeGuard":null,"tryCatchPattern":"catch (UnsupportedOperationException e) { if (e.getMessage().contains(\"compatible mode\")) { /* add compatible_mode to config and rebuild factory */ } }","preventionTips":["Always set compatible_mode when using the OceanBase dialect","Match the mode to the tenant type (MySQL vs Oracle mode)","Use factory overloads taking compatibleMode in programmatic use"],"tags":["jdbc","oceanbase","dialect","missing-config"],"backgroundTag":"missing-required-config","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}