Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XycKK-0007Ov-EU for pgsql-jdbc@arkaria.postgresql.org; Wed, 10 Dec 2014 08:08:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XycKI-0002CL-Qx for pgsql-jdbc@arkaria.postgresql.org; Wed, 10 Dec 2014 08:08:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XycKH-0002CE-TD for pgsql-jdbc@postgresql.org; Wed, 10 Dec 2014 08:08:49 +0000 Received: from mx3-phx2.redhat.com ([209.132.183.24]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XycKD-0004fG-2C for pgsql-jdbc@postgresql.org; Wed, 10 Dec 2014 08:08:48 +0000 Received: from zmail16.collab.prod.int.phx2.redhat.com (zmail16.collab.prod.int.phx2.redhat.com [10.5.83.18]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id sBA88fnL019853 for ; Wed, 10 Dec 2014 03:08:42 -0500 Date: Wed, 10 Dec 2014 03:08:41 -0500 (EST) From: Ondrej Chaloupka To: pgsql-jdbc@postgresql.org Message-ID: <804581036.23979739.1418198921811.JavaMail.zimbra@redhat.com> In-Reply-To: <1839434978.23979421.1418198887715.JavaMail.zimbra@redhat.com> Subject: Incorrect return code for error on call of commit during 2PC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.5.82.6] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF34 (Linux)/8.0.6_GA_5922) Thread-Topic: Incorrect return code for error on call of commit during 2PC Thread-Index: tyk0h+kNsfahyVl6aToSb63FnDq7HA== X-Pg-Spam-Score: -6.9 (------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Hi, it seems that PostgreSQL jdbc driver returns incorrect code on call of 'com= mit' during 2PC. Currently the driver returns XAER_RMERR. I expect that it's this call https://github.com/pgjdbc/pgjdbc/blob/master/org/postgresql/xa/PGXAConnecti= on.java#L528 But the XA spec (http://pubs.opengroup.org/onlinepubs/009680699/toc.pdf) sa= ys for XAER_RMERR that "An error occurred in committing the work performed on behalf of the transa= ction branch and the branch=E2=80=99s work has been rolled back. Note that return= ing this error signals a catastrophic event to a transaction manager since other resource managers may successfully commit their work on behalf of this branch. This = error should be returned only when a resource manager concludes that it can never commit the branch and that it cannot hold the branch=E2=80=99s resources in= a prepared state. Otherwise, [XA_RETRY] should be returned." In case there is longer discussion about scenario hitting this issue and ab= out handling this at RedHat bugzilla here: https://bugzilla.redhat.com/show_bug.cgi?id=3D988724