jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1060434 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/DatabaseJournal.java
Date Tue, 18 Jan 2011 16:09:08 GMT
Author: jukka
Date: Tue Jan 18 16:09:08 2011
New Revision: 1060434

URL: http://svn.apache.org/viewvc?rev=1060434&view=rev
Log:
JCR-2832: Crash when adding node to cluster with big journal on PSQL DB

Minor cleanup (better try-finally construct, throw exception instead of logging)

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/DatabaseJournal.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/DatabaseJournal.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/DatabaseJournal.java?rev=1060434&r1=1060433&r2=1060434&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/DatabaseJournal.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/DatabaseJournal.java
Tue Jan 18 16:09:08 2011
@@ -436,7 +436,7 @@ public class DatabaseJournal extends Abs
 
     /**
      * Synchronize contents from journal. May be overridden by subclasses.
-     * Override to do it in batchMode, since some databases (PSQL) when 
+     * Override to do it in batchMode, since some databases (PSQL) when
      * not in transactional mode, load all results in memory which causes
      * out of memory.
      *
@@ -447,16 +447,13 @@ public class DatabaseJournal extends Abs
     protected void doSync(long startRevision) throws JournalException {
         try {
             conHelper.startBatch();
-            super.doSync(startRevision);
-        } catch (SQLException e) {
-            // Should throw journal exception instead of just logging it?
-            log.error("couldn't sync the cluster node", e);
-        } finally {
             try {
+                super.doSync(startRevision);
+            } finally {
                 conHelper.endBatch(true);
-            } catch (SQLException e) {
-                log.warn("couldn't close connection", e);
             }
+        } catch (SQLException e) {
+            throw new JournalException("Couldn't sync the cluster node", e);
         }
     }
 



Mime
View raw message