[libpostgresql-jdbc-java] 87/128: Check server SQLState for xid does not exist and return XAException.XAER_NOTA from method along with exception.

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:18:34 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to annotated tag REL9_3_1100
in repository libpostgresql-jdbc-java.

commit 604b7546a3d9074d53042918dff981a4b46cd4b4
Author: Jeremy Whiting <whitingjr at hotmail.com>
Date:   Wed Jul 31 15:31:37 2013 +0100

    Check server SQLState for xid does not exist and return XAException.XAER_NOTA from method along with exception.
---
 org/postgresql/xa/PGXAConnection.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/org/postgresql/xa/PGXAConnection.java b/org/postgresql/xa/PGXAConnection.java
index c70d033..eec7620 100644
--- a/org/postgresql/xa/PGXAConnection.java
+++ b/org/postgresql/xa/PGXAConnection.java
@@ -42,6 +42,7 @@ public class PGXAConnection extends PGPooledConnection implements XAConnection,
      */
     private final BaseConnection conn;
     private final Logger logger;
+    public static final String UNDEFINED_OBJECT = "42704";
 
     /*
      * PGXAConnection-object can be in one of three states:
@@ -413,6 +414,10 @@ public class PGXAConnection extends PGPooledConnection implements XAConnection,
         }
         catch (SQLException ex)
         {
+        	if (UNDEFINED_OBJECT.equals(ex.getSQLState()))
+    		{
+        		throw new PGXAException(GT.tr("Error rolling back prepared transaction"), ex, XAException.XAER_NOTA);
+            }
             throw new PGXAException(GT.tr("Error rolling back prepared transaction"), ex, XAException.XAER_RMERR);
         }
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git



More information about the pkg-java-commits mailing list