jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From un...@apache.org
Subject svn commit: r1390868 - in /jackrabbit/branches/2.2/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/cluster/ main/java/org/apache/jackrabbit/core/state/ test/java/org/apache/jackrabbit/core/cluster/ test/resources/org/apache/jackrabbit/core/cl...
Date Thu, 27 Sep 2012 07:35:38 GMT
Author: unico
Date: Thu Sep 27 07:35:37 2012
New Revision: 1390868

URL: http://svn.apache.org/viewvc?rev=1390868&view=rev
Log:
JCR-3432 Failed Journal lock not propagated

Added:
    jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/FailUpdateOnJournalExceptionTest.java
      - copied unchanged from r1378050, jackrabbit/branches/2.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/FailUpdateOnJournalExceptionTest.java
    jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/TestJournal.java
      - copied unchanged from r1378050, jackrabbit/branches/2.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/TestJournal.java
    jackrabbit/branches/2.2/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/cluster/repository-with-test-journal.xml
      - copied unchanged from r1378050, jackrabbit/branches/2.4/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/cluster/repository-with-test-journal.xml
Modified:
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/UpdateEventChannel.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
    jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/TestAll.java

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java?rev=1390868&r1=1390867&r2=1390868&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java
Thu Sep 27 07:35:37 2012
@@ -533,7 +533,7 @@ public class ClusterNode implements Runn
         /**
          * {@inheritDoc}
          */
-        public void updateCreated(Update update) {
+        public void updateCreated(Update update) throws ClusterException {
             if (status != STARTED) {
                 log.info("not started: update create ignored.");
                 return;
@@ -542,11 +542,12 @@ public class ClusterNode implements Runn
                 Record record = producer.append();
                 update.setAttribute(ATTRIBUTE_RECORD, record);
             } catch (JournalException e) {
-                String msg = "Unable to create log entry.";
-                log.error(msg, e);
+                String msg = "Unable to create log entry: " + e.getMessage();
+                throw new ClusterException(msg, e);
             } catch (Throwable e) {
-                String msg = "Unexpected error while creating log entry.";
-                log.error(msg, e);
+                String msg = "Unexpected error while creating log entry: "
+                        + e.getMessage();
+                throw new ClusterException(msg, e);
             }
         }
 

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/UpdateEventChannel.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/UpdateEventChannel.java?rev=1390868&r1=1390867&r2=1390868&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/UpdateEventChannel.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/UpdateEventChannel.java
Thu Sep 27 07:35:37 2012
@@ -25,8 +25,9 @@ public interface UpdateEventChannel {
      * Called when an a update operation has been created.
      *
      * @param update update operation
+     * @throws ClusterException if an error occurs writing to the event channel.
      */
-    void updateCreated(Update update);
+    void updateCreated(Update update) throws ClusterException;
 
     /**
      * Called when an a update operation has been prepared.

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java?rev=1390868&r1=1390867&r2=1390868&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
Thu Sep 27 07:35:37 2012
@@ -29,6 +29,7 @@ import javax.jcr.nodetype.NoSuchNodeType
 import javax.jcr.nodetype.NodeType;
 
 import org.apache.jackrabbit.core.RepositoryImpl;
+import org.apache.jackrabbit.core.cluster.ClusterException;
 import org.apache.jackrabbit.core.cluster.UpdateEventChannel;
 import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.id.NodeId;
@@ -559,7 +560,11 @@ public class SharedItemStateManager
             virtualNodeReferences = new ChangeLog[virtualProviders.length];
 
             // let listener know about change
-            eventChannel.updateCreated(this);
+            try {
+                eventChannel.updateCreated(this);
+            } catch (ClusterException e) {
+                throw new ItemStateException(e.getMessage(), e);
+            }
 
             try {
                 writeLock = acquireWriteLock(local);

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/TestAll.java?rev=1390868&r1=1390867&r2=1390868&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/TestAll.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/TestAll.java
Thu Sep 27 07:35:37 2012
@@ -39,6 +39,7 @@ public class TestAll extends TestCase {
 
         suite.addTestSuite(ClusterRecordTest.class);
         suite.addTestSuite(DbClusterTest.class);
+        suite.addTestSuite(FailUpdateOnJournalExceptionTest.class);
 
         return suite;
     }



Mime
View raw message