incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1004786 - /incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceDerby.java
Date Tue, 05 Oct 2010 19:38:47 GMT
Author: kwright
Date: Tue Oct  5 19:38:47 2010
New Revision: 1004786

URL: http://svn.apache.org/viewvc?rev=1004786&view=rev
Log:
Attempt to correct CONNECTORS-111 by preserving the state when an exception occurs during
a commit or rollback.  Otherwise I cannot explain the symptoms seen.

Modified:
    incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceDerby.java

Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceDerby.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceDerby.java?rev=1004786&r1=1004785&r2=1004786&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceDerby.java
(original)
+++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceDerby.java
Tue Oct  5 19:38:47 2010
@@ -1068,7 +1068,7 @@ public class DBInterfaceDerby extends Da
       }
       catch (java.sql.SQLException e)
       {
-        throw new ManifoldCFException(e.getMessage(),e);
+        throw new ManifoldCFException(e.getMessage(),e,ManifoldCFException.DATABASE_CONNECTION_ERROR);
       }
       inTransaction = true;
     }
@@ -1081,8 +1081,7 @@ public class DBInterfaceDerby extends Da
   {
     if (inTransaction)
     {
-      depthCount--;
-      if (depthCount == 0)
+      if (depthCount == 1)
       {
         try
         {
@@ -1094,10 +1093,11 @@ public class DBInterfaceDerby extends Da
         }
         catch (java.sql.SQLException e)
         {
-          throw new ManifoldCFException(e.getMessage(),e);
+          throw new ManifoldCFException(e.getMessage(),e,ManifoldCFException.DATABASE_CONNECTION_ERROR);
         }
         inTransaction = false;
       }
+      depthCount--;
     }
     else
       throw new ManifoldCFException("Transaction nesting error!");
@@ -1109,8 +1109,7 @@ public class DBInterfaceDerby extends Da
   {
     if (inTransaction)
     {
-      depthCount--;
-      if (depthCount == 0)
+      if (depthCount == 1)
       {
         try
         {
@@ -1122,10 +1121,11 @@ public class DBInterfaceDerby extends Da
         }
         catch (java.sql.SQLException e)
         {
-          throw new ManifoldCFException(e.getMessage(),e);
+          throw new ManifoldCFException(e.getMessage(),e,ManifoldCFException.DATABASE_CONNECTION_ERROR);
         }
         inTransaction = false;
       }
+      depthCount--;
     }
     else
       throw new ManifoldCFException("Transaction nesting error!");



Mime
View raw message