directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1551487 - /directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTree.java
Date Tue, 17 Dec 2013 08:48:16 GMT
Author: elecharny
Date: Tue Dec 17 08:48:16 2013
New Revision: 1551487

URL: http://svn.apache.org/r1551487
Log:
Was a bit too aggressive when cleaning the cache... It has to be alive to remove all.

Modified:
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTree.java

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTree.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTree.java?rev=1551487&r1=1551486&r2=1551487&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTree.java
(original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTree.java
Tue Dec 17 08:48:16 2013
@@ -28,6 +28,7 @@ import java.util.concurrent.ConcurrentLi
 import java.util.concurrent.locks.ReentrantLock;
 
 import net.sf.ehcache.Cache;
+import net.sf.ehcache.Status;
 import net.sf.ehcache.config.CacheConfiguration;
 
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
@@ -305,7 +306,11 @@ public class PersistedBTree<K, V> extend
         // readTransactions.clear();
         
         // Clean the cache
-        cache.removeAll();
+        if ( cache.getStatus() == Status.STATUS_ALIVE )
+        {
+            cache.removeAll();
+        }
+        
         cache.dispose();
 
         rootPage = null;



Mime
View raw message