Message-ID: From: "denis-anisimov (@denis-anisimov)" To: "pgjdbc/pgjdbc" Date: Wed, 27 May 2026 09:11:57 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #4114: fix: PGXAConnection no longer saves and restores the caller's autoCommit In-Reply-To: References: List-Id: X-GitHub-Author-Login: denis-anisimov X-GitHub-Comment-Id: 4553138299 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 4114 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/4114#issuecomment-4553138299 Content-Type: text/plain; charset=utf-8 The original problem has been discovered with the driver using it with Geronimo as a TM inside TomEE. If DataSource is configured using `DefaultAutoCommit false` property then method `XAResource::recover` begins a transaction with the previous driver version. And then it becomes impossible to complete recovery using methods "commit"/"rollback" since there is a check in the method "commitPrepared" against the opened transaction. It throws XAException with RMERR ("-3" ) error code which is fatal for the TM, it may not be handled properly in any way. Now the latest driver version with this fix is tested and there are no regressions noticed and the behavior of the "XAResource::recover" method is correct: there is no transaction anymore. Also the check in the "commitPrepared" method is corrected and it throws now RMFAIL ("-7") error which Geronimo TM handles properly.