jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marti...@apache.org
Subject svn commit: r749237 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
Date Mon, 02 Mar 2009 08:48:44 GMT
Author: martijnh
Date: Mon Mar  2 08:48:44 2009
New Revision: 749237

URL: http://svn.apache.org/viewvc?rev=749237&view=rev
Log:
JCR-1117 Bundle cache is not rolled back when the storage of a ChangeLog fails

- Applied third version of the patch.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java?rev=749237&r1=749236&r2=749237&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
Mon Mar  2 08:48:44 2009
@@ -524,6 +524,26 @@
      */
     public synchronized void store(ChangeLog changeLog)
             throws ItemStateException {
+        boolean success = false;
+        try {
+            storeInternal(changeLog);
+            success = true;
+        } finally {
+            if (!success) {
+                bundles.clear();
+                missing.clear();
+            }
+        }
+    }
+
+    /**
+     * Stores the given changelog and updates the bundle cache.
+     * 
+     * @param changeLog the changelog to store
+     * @throws ItemStateException on failure
+     */
+    private void storeInternal(ChangeLog changeLog)
+            throws ItemStateException {
         // delete bundles
         HashSet deleted = new HashSet();
         Iterator iter = changeLog.deletedStates();



Mime
View raw message