]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliCDBManager.cxx
Fixed compilation
[u/mrichter/AliRoot.git] / STEER / AliCDBManager.cxx
index f8e6dc10f5dc5929ae787bacafbd01ca15f3208a..bc3f46ea1eda9544664caf478e5a2ec63f5f4fe8 100644 (file)
@@ -328,14 +328,20 @@ Bool_t AliCDBManager::Drain(AliCDBEntry *entry) {
 void AliCDBManager::SetDefaultStorage(const char* dbString) {
 // sets default storage from URI string
        
-       AliInfo(Form("Setting Default storage to: %s",dbString));
-
        // checking whether we are in the raw case
        TString dbStringTemp(dbString);
        if (dbStringTemp == "raw://")
        {
                fRaw = kTRUE;
                AliInfo("Setting the run-number will set the corresponding OCDB for raw data reconstruction.");
+               AliInfo("Connecting to the grid...");
+               if(!gGrid) {
+                       TGrid::Connect("alien://","");
+                       if(!gGrid) {
+                               AliError("Connection to alien failed!");
+                               return;
+                       }
+               }
                return;
        }
 
@@ -499,6 +505,9 @@ void AliCDBManager::UnsetDefaultStorage() {
                AliWarning("Clearing cache!");
                ClearCache();
        }
+
+       fRun = fStartRunLHCPeriod = fEndRunLHCPeriod = -1;
+       fRaw = kFALSE;
        
        fDefaultStorage = 0x0;
 }
@@ -523,7 +532,7 @@ void AliCDBManager::SetSpecificStorage(const char* calibType, AliCDBParam* param
 // calibType must be a valid CDB path! (3 level folder structure)
 
 
-       if(!fDefaultStorage) {
+       if(!fDefaultStorage && !fRaw) {
                AliError("Please activate a default storage first!");
                return;
        }
@@ -638,10 +647,10 @@ AliCDBEntry* AliCDBManager::Get(const AliCDBId& query) {
                 return NULL;
        }
 
-       if(fLock && query.GetFirstRun() != fRun)
+       if(fLock && !(fRun >= query.GetFirstRun() && fRun <= query.GetLastRun())) 
                AliFatal("Lock is ON: cannot use different run number than the internal one!");
        
-       if(fCache && query.GetFirstRun() != fRun)
+       if(fCache && !(fRun >= query.GetFirstRun() && fRun <= query.GetLastRun())) 
                AliWarning("Run number explicitly set in query: CDB cache temporarily disabled!");
 
        AliCDBEntry *entry=0;
@@ -1103,6 +1112,11 @@ void AliCDBManager::ClearCache(){
 void AliCDBManager::UnloadFromCache(const char* path){
 // unload cached object
 
+       if(!fActiveStorages.GetEntries()) {
+               AliDebug(2, Form("No active storages. Object \"%s\" is not unloaded from cache", path));
+               return;
+       }
+
        AliCDBPath queryPath(path);
        if(!queryPath.IsValid()) return;