Message-ID: From: "CTH57 (@CTH57)" To: "pgjdbc/pgjdbc" Date: Mon, 08 Dec 2025 10:20:52 +0000 Subject: [pgjdbc/pgjdbc] issue #3892: org.postgresql.xa.PGXAConnection.prepare(Xid) should return XA_RDONLY List-Id: X-GitHub-Author-Id: 248448994 X-GitHub-Author-Login: CTH57 X-GitHub-Issue: 3892 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: closed X-GitHub-Type: issue X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3892 Content-Type: text/plain; charset=utf-8 **Describe the issue** This issue is a possible misalignment of pgjdbc from the XA specification. PGXAConnection.prepare(Xid) should return XA_RDONLY when the connection is read-only. Instead, PGXAConnection.prepare(Xid) tries to execute an update on the connection, which inevitably fails. **Driver Version?** 42.7.8 **Java Version?** 21.0.6 **OS Version?** **PostgreSQL Version?** 17.4 **To Reproduce** Create a XATransaction with at least one readonly connection **Expected behaviour** No exception when commit the transaction **Logs** ```