activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r480185 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaPersistenceAdapter.java
Date Tue, 28 Nov 2006 20:08:27 GMT
Author: rajdavies
Date: Tue Nov 28 12:08:26 2006
New Revision: 480185

URL: http://svn.apache.org/viewvc?view=rev&rev=480185
Log:
Ensure store is properly deleted, even if not initialized

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaPersistenceAdapter.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaPersistenceAdapter.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaPersistenceAdapter.java?view=diff&rev=480185&r1=480184&r2=480185
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaPersistenceAdapter.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaPersistenceAdapter.java
Tue Nov 28 12:08:26 2006
@@ -166,6 +166,8 @@
             }else{
                 theStore.delete();
             }
+        }else {
+            StoreFactory.delete(getStoreName());
         }
     }
 
@@ -252,14 +254,20 @@
     public void setMaximumDestinationCacheSize(int maximumDestinationCacheSize){
         this.maximumDestinationCacheSize=maximumDestinationCacheSize;
     }
+    
 
     protected synchronized Store getStore() throws IOException{
         if(theStore==null){
             String name=dir.getAbsolutePath()+File.separator+"kaha.db";
-            theStore=StoreFactory.open(name,"rw");
+            theStore=StoreFactory.open(getStoreName(),"rw");
             theStore.setMaxDataFileLength(maxDataFileLength);
             theStore.setIndexType(indexType);
         }
         return theStore;
+    }
+    
+    private String getStoreName(){
+        String name=dir.getAbsolutePath()+File.separator+"kahadb";
+        return name;
     }
 }



Mime
View raw message