You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2014/11/02 16:57:05 UTC

svn commit: r1636147 - in /manifoldcf/branches/dev_1x: ./ framework/ framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java

Author: kwright
Date: Sun Nov  2 15:57:04 2014
New Revision: 1636147

URL: http://svn.apache.org/r1636147
Log:
Pull up postgresql error code issue from trunk, part of CONNECTORS-1090.

Modified:
    manifoldcf/branches/dev_1x/   (props changed)
    manifoldcf/branches/dev_1x/framework/   (props changed)
    manifoldcf/branches/dev_1x/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java

Propchange: manifoldcf/branches/dev_1x/
------------------------------------------------------------------------------
  Merged /manifoldcf/trunk:r1636146

Propchange: manifoldcf/branches/dev_1x/framework/
------------------------------------------------------------------------------
  Merged /manifoldcf/trunk/framework:r1636146

Modified: manifoldcf/branches/dev_1x/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java?rev=1636147&r1=1636146&r2=1636147&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java (original)
+++ manifoldcf/branches/dev_1x/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java Sun Nov  2 15:57:04 2014
@@ -611,7 +611,10 @@ public class DBInterfacePostgreSQL exten
       return theException;
     Throwable e = theException.getCause();
     if (!(e instanceof java.sql.SQLException))
+    {
+      //e.printStackTrace();
       return theException;
+    }
     if (Logging.db.isDebugEnabled())
       Logging.db.debug("Exception "+theException.getMessage()+" is possibly a transaction abort signal");
     java.sql.SQLException sqlException = (java.sql.SQLException)e;
@@ -628,8 +631,14 @@ public class DBInterfacePostgreSQL exten
     // one could make.)
     if (sqlState != null && sqlState.equals("23505"))
       return new ManifoldCFException(message,e,ManifoldCFException.DATABASE_TRANSACTION_ABORT);
+    // New Postgresql behavior (9.3): sometimes we don't get an exception thrown, but the transaction is dead nonetheless.
+    if (sqlState != null && sqlState.equals("25P02"))
+      return new ManifoldCFException(message,e,ManifoldCFException.DATABASE_TRANSACTION_ABORT);
+      
     if (Logging.db.isDebugEnabled())
       Logging.db.debug("Exception "+theException.getMessage()+" is NOT a transaction abort signal");
+    //e.printStackTrace();
+    //System.err.println("sqlstate = "+sqlState);
     return theException;
   }