{"record":{"id":"dd4c276fa226de9f","repo":"apache/seatunnel","slug":"common-writer-operation-failed-dd4c27","errorCode":"COMMON_WRITER_OPERATION_FAILED","errorMessage":"unable to open JDBC sink aggregated committer","messagePattern":"unable to open JDBC sink aggregated committer","errorType":"error_code","errorClass":"JdbcConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/sink/JdbcSinkAggregatedCommitter.java","lineNumber":72,"sourceCode":"    private final JdbcSinkConfig jdbcSinkConfig;\n\n    public JdbcSinkAggregatedCommitter(JdbcSinkConfig jdbcSinkConfig) {\n        this.jdbcSinkConfig = jdbcSinkConfig;\n    }\n\n    @Override\n    public void init() {\n        this.xaFacade =\n                XaFacade.fromJdbcConnectionOptions(jdbcSinkConfig.getJdbcConnectionConfig());\n        this.xaGroupOps = new XaGroupOpsImpl(xaFacade);\n    }\n\n    private void tryOpen() throws IOException {\n        if (!xaFacade.isOpen()) {\n            try {\n                xaFacade.open();\n            } catch (Exception e) {\n                throw new JdbcConnectorException(\n                        CommonErrorCodeDeprecated.WRITER_OPERATION_FAILED,\n                        \"unable to open JDBC sink aggregated committer\",\n                        e);\n            }\n        }\n    }\n\n    @Override\n    public List<JdbcAggregatedCommitInfo> commit(\n            List<JdbcAggregatedCommitInfo> aggregatedCommitInfos) throws IOException {\n        return commitPreparedTransactions(aggregatedCommitInfos);\n    }\n\n    /**\n     * Reconciles checkpoint XIDs with the resource manager using commit-order evidence. Checkpoint\n     * XIDs from the first still-prepared transaction onward must all be present in the recovery\n     * scan and are replayed strictly. An all-absent batch is treated as already resolved, while an\n     * absent prefix before a still-prepared suffix is treated as already resolved only after that","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/sink/JdbcSinkAggregatedCommitter.java#L54-L90","documentation":"JdbcSinkAggregatedCommitter.tryOpen() opens the XA facade used by the committer; if xaFacade.open() throws, this WRITER_OPERATION_FAILED error is thrown. The committer cannot commit or abort prepared transactions without an open XA connection.","triggerScenarios":"tryOpen is called from restoreCommit, commitPreparedTransactions, and abort; any Exception from xaFacade.open() (failed XA connection creation) triggers it.","commonSituations":"Database unreachable at commit time; credentials changed or expired between write and commit phases; DB exhausted connection limit; XA privileges missing for the committer's user.","solutions":["Check the cause for the JDBC connection error (URL, credentials, network)","Verify DB connectivity from the coordinating node at commit time","Confirm the user retains XA privileges and DB connection limits are not exhausted","Rerun commit from checkpoint; commits are idempotent via XA recovery"],"exampleFix":"// before\n\"url\":\"jdbc:postgresql://db:5432/app\" // max_connections exhausted\n// after: increase max_connections or pool size in config","handlingStrategy":"validation","validationCode":"// pre-check commit-time connectivity\ntry (Connection c = DriverManager.getConnection(url, user, pass)) { assert c.isValid(5); }","typeGuard":null,"tryCatchPattern":"try { committer.commit(xids); } catch (JdbcConnectorException e) { if (isConnectionError(e.getCause())) retryAfterReconnect(); else throw e; }","preventionTips":["Check DB connection limits and pool sizing","Re-verify credentials before commit phase (they may rotate)","Grant XA privileges to the committer user","Run commits on nodes with proven DB connectivity"],"tags":["jdbc","xa","committer","connection"],"backgroundTag":"database-connection-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}