{"record":{"id":"2ef47c53f814b0ef","repo":"t8y2/dbx","slug":"this-jdbc-driver-does-not-support-transactions","errorCode":null,"errorMessage":"This JDBC driver does not support transactions","messagePattern":"This JDBC driver does not support transactions","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"plugins/jdbc/src/main/java/app/dbx/jdbc/DbxJdbcPlugin.java","lineNumber":1050,"sourceCode":"            result.set(\"columns\", columns);\n            result.set(\"rows\", rows);\n            result.put(\"affected_rows\", columns.isEmpty() ? Math.max(executed.updateCount(), 0) : 0);\n            result.put(\"execution_time_ms\", (System.nanoTime() - start) / 1_000_000);\n            result.put(\"truncated\", truncated);\n            return result;\n        }\n    }\n\n    private static ObjectNode beginManualTransaction(JsonNode connection, String database, String schema)\n        throws SQLException {\n        if (manualTransactionActive) {\n            throw new SQLException(\"A manual transaction is already active\");\n        }\n        Connection conn = openConnection(connection);\n        DatabaseMetaData metadata = readMetadata(conn::getMetaData);\n        Boolean supportsTransactions = metadata == null ? null : readMetadata(metadata::supportsTransactions);\n        if (Boolean.FALSE.equals(supportsTransactions)) {\n            throw new SQLFeatureNotSupportedException(\"This JDBC driver does not support transactions\");\n        }\n        applyExecutionContext(connection, conn, database, schema);\n        conn.setAutoCommit(false);\n        manualTransactionActive = true;\n        return okResult();\n    }\n\n    private static JsonNode executeInManualTransaction(\n        JsonNode connection,\n        String sql,\n        String database,\n        String schema,\n        int maxRows,\n        int fetchSize,\n        int rowOffset,\n        int timeoutSecs\n    ) throws Exception {\n        Connection conn = activeManualTransactionConnection(connection);","sourceCodeStart":1032,"sourceCodeEnd":1068,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/plugins/jdbc/src/main/java/app/dbx/jdbc/DbxJdbcPlugin.java#L1032-L1068","documentation":"After opening the connection, beginManualTransaction queries DatabaseMetaData.supportsTransactions(). If metadata explicitly reports false (not null/unknown), it throws SQLFeatureNotSupportedException because setAutoCommit(false) and manual commits would be meaningless. This is a capability check driven by the driver's own metadata.","triggerScenarios":"Beginning a manual transaction against a database/driver that declares supportsTransactions() == false — e.g. certain lightweight embedded engines, CSV/flat-file JDBC bridges, or read-only proxy drivers.","commonSituations":"Pointing the plugin at a non-transactional store via a minimal JDBC driver, using a wrapper driver that reports capabilities incorrectly, or testing against an in-memory/flat-file backend.","solutions":["Switch to a database with real transaction support (PostgreSQL, MySQL/InnoDB, SQLite, etc.) for workloads needing atomicity.","If the backend does support transactions but the driver misreports it, use the vendor's official driver instead of a bridge/wrapper.","Remove manual-transaction usage for this connection and rely on autocommit semantics.","Verify with a direct JDBC snippet: conn.getMetaData().supportsTransactions() to confirm the capability before debugging the plugin."],"exampleFix":"// before\nbeginTx(connCfg);   // driver: flat-file JDBC bridge -> SQLFeatureNotSupportedException\n// after\n// run statements in autocommit mode; no manual transaction\nexec(connCfg, sql);","handlingStrategy":"validation","validationCode":"// Java: capability check before beginning a manual transaction\njava.sql.Connection c = /* open via plain JDBC */;\nboolean ok = c.getMetaData().supportsTransactions();\nc.close();\nif (!ok) throw new IllegalStateException(\"backend does not support transactions; skip manual tx\");","typeGuard":null,"tryCatchPattern":"try {\n    plugin.beginManualTransaction(connCfg);\n} catch (java.sql.SQLFeatureNotSupportedException e) {\n    // fall back to autocommit execution\n    plugin.execute(connCfg, statements);\n    return;\n}","preventionTips":["Check supportsTransactions() when onboarding a new database/driver","Avoid minimal bridge drivers (CSV/file-backed) for transactional workloads","Use vendor-official drivers that report capabilities correctly","Design scripts with an autocommit fallback path for non-transactional backends"],"tags":["jdbc","transactions","driver-capability"],"backgroundTag":"transactions-not-supported","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}