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;
     }
 }


Reply via email to