Bug fix. Removed delete statement
[u/mrichter/AliRoot.git] / STEER / AliCDBGrid.cxx
index df3915d..300265b 100644 (file)
@@ -64,6 +64,9 @@ fCleanupInterval(cleanupInterval)
                        AliInfo(Form("gGrid = %x; fGridUrl = %s; gGrid->GridUrl() = %s",gGrid,fGridUrl.Data(), gGrid->GridUrl()));
                        AliInfo(Form("fUser = %s; gGrid->GetUser() = %s",fUser.Data(), gGrid->GetUser()));
                }
+               AliDebug(2,Form("1. Grid Url = %s",fGridUrl.Data()));
+               if (fGridUrl == "raw://") fGridUrl = "alien://";
+               AliDebug(2,Form("2. Grid Url = %s (should be different from previous in cas eof raw)", fGridUrl.Data()));
                TGrid::Connect(fGridUrl.Data(),fUser.Data());
        }
 
@@ -319,6 +322,13 @@ Bool_t AliCDBGrid::PrepareId(AliCDBId& id) {
        }
        delete res;
 
+       // GRP entries with explicitly set version escape default incremental versioning
+       if(id.GetPath().Contains("GRP") && id.HasVersion() && lastVersion!=0)
+       {
+               AliDebug(5,Form("Entry %s won't be put in the destination OCDB", id.ToString().Data()));
+               return kFALSE;
+       }
+
        id.SetVersion(lastVersion + 1);
        id.SetSubVersion(0);
 
@@ -999,8 +1009,9 @@ Bool_t AliCDBGridFactory::Validate(const char* gridString) {
 // check if the string is valid Grid URI
 
         TRegexp gridPattern("^alien://.+$");
+        TRegexp gridRawPattern("^raw://.+$");
 
-        return TString(gridString).Contains(gridPattern);
+        return (TString(gridString).Contains(gridPattern)||TString(gridString).Contains(gridRawPattern));
 }
 
 //_____________________________________________________________________________
@@ -1012,6 +1023,7 @@ AliCDBParam* AliCDBGridFactory::CreateParameter(const char* gridString) {
        }
 
        TString buffer(gridString);
+       Bool_t rawFlag = kFALSE; // flag to say whether we are in the "raw://" case
 
        TString gridUrl         = "alien://";
        TString user            = "";
@@ -1033,6 +1045,10 @@ AliCDBParam* AliCDBGridFactory::CreateParameter(const char* gridString) {
                        if(entry.BeginsWith("alien://")) { // maybe it's a gridUrl!
                                gridUrl = entry;
                                continue;
+                       } else if(entry.BeginsWith("raw://")) { // maybe it's a gridRawUrl!
+                               gridUrl = entry;
+                               rawFlag = kTRUE;
+                               continue;
                        } else {
                                AliError(Form("Invalid entry! %s",entry.Data()));
                                continue;
@@ -1103,7 +1119,7 @@ AliCDBParam* AliCDBGridFactory::CreateParameter(const char* gridString) {
        AliDebug(2, Form("local cache size: %d", cacheSize));
        AliDebug(2, Form("local cache cleanup interval: %d", cleanupInterval));
 
-       if(dbFolder == ""){
+       if(dbFolder == "" && !rawFlag){
                AliError("Base folder must be specified!");
                return NULL;
        }
@@ -1188,6 +1204,7 @@ AliCDBGridParam::AliCDBGridParam(const char* gridUrl, const char* user, const ch
                        fDBFolder.Data(), fSE.Data(), fCacheFolder.Data(),
                        fOperateDisconnected, fCacheSize, fCleanupInterval);
 
+       AliDebug(2,Form("uri = %s", uri.Data()));
        SetURI(uri.Data());
 }