jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cko...@apache.org
Subject svn commit: r1536280 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: TransactionContext.java persistence/pool/BundleDbPersistenceManager.java
Date Mon, 28 Oct 2013 08:05:12 GMT
Author: ckoell
Date: Mon Oct 28 08:05:12 2013
New Revision: 1536280

URL: http://svn.apache.org/r1536280
Log:
JCR-3682 Better Exception Handling in TransactionContext to handle unchecked exceptions

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransactionContext.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransactionContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransactionContext.java?rev=1536280&r1=1536279&r2=1536280&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransactionContext.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransactionContext.java
Mon Oct 28 08:05:12 2013
@@ -144,6 +144,9 @@ public class TransactionContext {
             } catch (TransactionException e) {
                 txe = e;
                 break;
+            } catch (Exception e) {
+                txe = new TransactionException("Error while preparing resource " + resources,
e);
+                break;
             }
         }
 
@@ -187,7 +190,7 @@ public class TransactionContext {
             if (txe != null) {
                 try {
                     resource.rollback(this);
-                } catch (TransactionException e) {
+                } catch (Exception e) {
                     log.warn("Unable to rollback changes on " + resource, e);
                 }
             } else {
@@ -196,6 +199,8 @@ public class TransactionContext {
                     heuristicCommit = true;
                 } catch (TransactionException e) {
                     txe = e;
+                } catch (Exception e) {
+                    txe = new TransactionException("Error while committing resource " + resource,
e);
                 }
             }
         }
@@ -234,7 +239,7 @@ public class TransactionContext {
             InternalXAResource resource = resources[i];
             try {
                 resource.rollback(this);
-            } catch (TransactionException e) {
+            } catch (Exception e) {
                 log.warn("Unable to rollback changes on " + resource, e);
                 errors++;
             }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java?rev=1536280&r1=1536279&r2=1536280&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java
Mon Oct 28 08:05:12 2013
@@ -928,7 +928,7 @@ public class BundleDbPersistenceManager
             } finally {
                 in.close();
             }
-        } catch (Exception e) {
+        } catch (IOException e) {
             SQLException exception =
                 new SQLException("Failed to parse bundle " + id);
             exception.initCause(e);



Mime
View raw message