{"record":{"id":"db08a69f544a3a17","repo":"apache/seatunnel","slug":"failed-to-check-jdbc-savepoint-support-fallback-t","errorCode":null,"errorMessage":"Failed to check JDBC savepoint support; fallback to full transaction rollback.","messagePattern":"Failed to check JDBC savepoint support; fallback to full transaction rollback\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/sink/JdbcSinkWriter.java","lineNumber":415,"sourceCode":"            return true;\n        } catch (SQLException e) {\n            throw new JdbcConnectorException(\n                    JdbcConnectorErrorCode.TRANSACTION_OPERATION_FAILED,\n                    \"set savepoint failed,\" + e.getMessage(),\n                    e);\n        }\n    }\n\n    private boolean supportsSavepoints() {\n        if (supportsSavepoints != null) {\n            return supportsSavepoints;\n        }\n        try {\n            DatabaseMetaData metaData = connectionProvider.getConnection().getMetaData();\n            supportsSavepoints = metaData != null && metaData.supportsSavepoints();\n        } catch (SQLException e) {\n            supportsSavepoints = false;\n            log.warn(\n                    \"Failed to check JDBC savepoint support; fallback to full transaction rollback.\",\n                    e);\n        }\n        return supportsSavepoints;\n    }\n\n    private void logSavepointUnsupported() {\n        if (savepointUnsupportedLogged) {\n            return;\n        }\n        savepointUnsupportedLogged = true;\n        log.warn(\n                \"JDBC driver does not support savepoints. Row-error handling will keep \"\n                        + \"auto-flushed rows pending until checkpoint commit and fall back to full \"\n                        + \"transaction rollback on row-level write failure. table={}\",\n                sinkTablePath);\n    }\n","sourceCodeStart":397,"sourceCodeEnd":433,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/sink/JdbcSinkWriter.java#L397-L433","documentation":"JdbcSinkWriter.supportsSavepoints() queries DatabaseMetaData.supportsSavepoints() once and caches the result. If the metadata call throws SQLException (connection dropped, DB error), the flag is conservatively set to false and this WARN says the writer will fall back to rolling back whole transactions instead of using savepoints.","triggerScenarios":"First call to supportsSavepoints() while the pooled connection's metadata is unreadable: stale/broken connection, permission restrictions on metadata, driver not implementing supportsSavepoints properly.","commonSituations":"Connection invalidated by idle timeout or network reset right before the check; restricted DB user (metadata disabled); older drivers throwing on metadata calls.","solutions":["Verify the connection is alive / pool validation is configured","Re-run the job — the check is retried on a fresh connection","Grant the DB user permission to read metadata if restricted","Upgrade the driver if supportsSavepoints() is broken there"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// preflight metadata check on a fresh connection\ntry (Connection c = ds.getConnection()) {\n    boolean ok = c.getMetaData().supportsSavepoints();\n    log.info(\"savepoints supported: {}\", ok);\n}","typeGuard":null,"tryCatchPattern":"try {\n    supports = conn.getMetaData().supportsSavepoints();\n} catch (SQLException e) {\n    supports = false; // safe fallback: full rollback\n    log.warn(\"savepoint check failed, using full rollback\", e);\n}","preventionTips":["Enable Hikari connection validation to avoid stale connections","Grant users metadata access","Retry the job once if the warning appears on first use"],"tags":["jdbc","savepoint","fallback"],"backgroundTag":"sql-query-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}