mirror of https://github.com/apache/activemq.git
Ensure store is properly deleted, even if not initialized
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@480185 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fbce65019c
commit
5c587a2f13
|
@ -166,6 +166,8 @@ public class KahaPersistenceAdapter implements PersistenceAdapter{
|
|||
}else{
|
||||
theStore.delete();
|
||||
}
|
||||
}else {
|
||||
StoreFactory.delete(getStoreName());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -253,13 +255,19 @@ public class KahaPersistenceAdapter implements PersistenceAdapter{
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue