{"record":{"id":"365b0a2396f8c987","repo":"apache/incubator-seata","slug":"unknown-dbtype-s","errorCode":null,"errorMessage":"unknown dbType:%s","messagePattern":"unknown dbType:(.+?)","errorType":"exception","errorClass":"NotSupportYetException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/seata/core/store/db/sql/lock/AbstractLockStoreSql.java","lineNumber":134,"sourceCode":"     */\n    private static final String CHECK_LOCK_SQL = \"select \" + ALL_COLUMNS + \" from \" + LOCK_TABLE_PLACE_HOLD\n            + \" where \" + LOCK_TABLE_PK_WHERE_CONDITION_PLACE_HOLD\n            + \" order by status desc \";\n\n    /**\n     * The constant QUERY_ALL_LOCK.\n     */\n    private static final String QUERY_ALL_LOCK = \"select \" + ALL_COLUMNS + \" from \" + LOCK_TABLE_PLACE_HOLD\n            + WHERE_PLACE_HOLD + \" order by gmt_create desc \";\n\n    @Override\n    public String getAllLockSql(String lockTable, String whereCondition) {\n        return QUERY_ALL_LOCK.replace(LOCK_TABLE_PLACE_HOLD, lockTable).replace(WHERE_PLACE_HOLD, whereCondition);\n    }\n\n    @Override\n    public String getInsertLockSQL(String lockTable) {\n        throw new NotSupportYetException(\"unknown dbType:\" + CONFIG.getConfig(ConfigurationKeys.STORE_DB_TYPE));\n    }\n\n    @Override\n    public String getDeleteLockSql(String lockTable) {\n        return DELETE_LOCK_SQL.replace(LOCK_TABLE_PLACE_HOLD, lockTable);\n    }\n\n    @Override\n    public String getBatchDeleteLockSql(String lockTable, int rowSize) {\n        List<String> pkNameList = new ArrayList<>();\n        pkNameList.add(ServerTableColumnsName.LOCK_TABLE_ROW_KEY);\n        String whereCondition = buildWhereConditionByPKs(pkNameList, rowSize, MAX_IN_SIZE);\n        return BATCH_DELETE_LOCK_SQL\n                .replace(LOCK_TABLE_PLACE_HOLD, lockTable)\n                .replace(LOCK_TABLE_PK_WHERE_CONDITION_PLACE_HOLD, whereCondition);\n    }\n\n    @Override","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/apache/incubator-seata/blob/e01f97c6db397165050caa6764020410c2c8199a/core/src/main/java/org/apache/seata/core/store/db/sql/lock/AbstractLockStoreSql.java#L116-L152","documentation":"AbstractLockStoreSql.getInsertLockSQL is the base-class fallback: every dialect-specific subclass (MySqlLockStoreSql, PostgresqlLockStoreSql, OracleLockStoreSql, ...) overrides it with a real INSERT for the lock table. If the configured store.db.type does not resolve to one of those subclasses, the base implementation throws NotSupportYetException('unknown dbType:' + current store.db.type value), flagging unsupported DB storage.","triggerScenarios":"store.mode=db with store.db.type set to a value that has no dedicated LockStoreSql dialect (anything beyond mysql/h2/postgresql/oracle/derby/db2/mssql etc. depending on version) — e.g. a typo ('mydb', 'mysql8'), an unsupported database (sqlite, clickhouse), or the store SQL factory falling back to the abstract base because the type key didn't match.","commonSituations":"Typo in store.db.type in file.conf/application.yml; using a database Seata's lock store does not have dialect SQL for; after upgrading, renamed/removed db type values; case sensitivity issues in the config value.","solutions":["Correct store.db.type to a supported value exactly as documented (e.g. 'mysql', 'postgresql', 'oracle', 'db2', 'mariadb' where supported by your version).","Check the error text: it echoes the current config value — fix whatever that literal shows (typo, whitespace, wrong case).","If your DB is genuinely unsupported, use store.mode=file (or db with a compatible dialect), or implement a LockStoreSql dialect and register it in the store-sql SPI/factory.","Re-read the store section of your version's config template to confirm valid db type names."],"exampleFix":"# before\nseata:\n  store:\n    mode: db\n    db:\n      db-type: mydb      # typo -> unknown dbType:mydb on first lock insert\n\n# after\nseata:\n  store:\n    mode: db\n    db:\n      db-type: mysql","handlingStrategy":"validation","validationCode":"String dbType = seataConfig.get(\"store.db.type\");\nSet<String> supported = new HashSet<>(Arrays.asList(\"mysql\", \"h2\", \"postgresql\", \"oracle\", \"derby\", \"db2\", \"mariadb\", \"mssql\")); // adjust per version\nif (!supported.contains(dbType == null ? null : dbType.trim().toLowerCase())) {\n    throw new ConfigurationException(\"Unsupported store.db.type '\" + dbType + \"' - use one of \" + supported);\n}","typeGuard":"// language-appropriate narrowing for config values\nstatic boolean isSupportedDbType(String dbType) {\n    if (dbType == null) return false;\n    try {\n        org.apache.seata.common.util.StringUtils.toLowerCase(dbType);\n        return DBType.valueof(dbType.trim().toLowerCase()) != null;\n    } catch (IllegalArgumentException e) {\n        return false;\n    }\n}","tryCatchPattern":"try {\n    lockDao.acquireLock(conn, locks);\n} catch (NotSupportYetException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"unknown dbType:\")) {\n        throw new ConfigurationException(\"store.db.type has no lock-store SQL dialect: \" + e.getMessage(), e);\n    }\n    throw e;\n}","preventionTips":["Copy store.db.type verbatim from the official template for your Seata version.","Validate db type against DBType enum values at startup before any transaction load hits the lock store.","If you need an unsupported DB, plan for store.mode=file or a custom LockStoreSql dialect instead of discovering this at first lock insert."],"tags":["configuration","store","lock","dbtype","sql-dialect","unsupported"],"backgroundTag":null,"analyzedSha":"e01f97c6db397165050caa6764020410c2c8199a","analyzedAt":"2026-08-14T10:23:53.097Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}