jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r599769 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java
Date Fri, 30 Nov 2007 10:30:28 GMT
Author: stefan
Date: Fri Nov 30 02:30:27 2007
New Revision: 599769

URL: http://svn.apache.org/viewvc?rev=599769&view=rev
Log:
JCR-1246: potential endless loop in DatabasePersistenceManager.store()

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java?rev=599769&r1=599768&r2=599769&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java
Fri Nov 30 02:30:27 2007
@@ -286,20 +286,26 @@
                     ise = e;
                 }
 
-                if (ise != null && ise.getCause() instanceof SQLException
-                        && --trials > 0) {
-                    // a SQLException has been thrown, try to reconnect
-                    log.warn("storing changes failed, about to reconnect...", ise.getCause());
+                if (ise != null && ise.getCause() instanceof SQLException) {
+                    // a SQLException has been thrown
+                    if (--trials > 0) {
+                        // try to reconnect
+                        log.warn("storing changes failed, about to reconnect...", ise.getCause());
 
-                    // try to reconnect
-                    if (reestablishConnection()) {
-                        // now let's give it another try
-                        ise = null;
-                        continue;
-                    } else {
-                        // reconnect failed, proceed with error processing
-                        break;
+                        // try to reconnect
+                        if (reestablishConnection()) {
+                            // now let's give it another try
+                            ise = null;
+                            continue;
+                        } else {
+                            // reconnect failed, proceed with error processing
+                            break;
+                        }
                     }
+                } else {
+                    // a non-SQLException has been thrown, 
+                    // proceed with error processing
+                    break;
                 }
             }
 



Mime
View raw message