do not update GRP-like entries while allows the normal behaviour when copying cdb...
authorrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 May 2009 13:52:57 +0000 (13:52 +0000)
committerrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 May 2009 13:52:57 +0000 (13:52 +0000)
STEER/AliCDBGrid.cxx

index 49b8526..e5c9616 100644 (file)
@@ -322,9 +322,13 @@ Bool_t AliCDBGrid::PrepareId(AliCDBId& id) {
        }
        delete res;
 
-       if (!id.HasVersion()){
-               id.SetVersion(lastVersion + 1);
+       // in case of GRP-like objects, do not put them if it would update a per-run entry already in place
+       if ( id.GetVersion()==1 && (id.GetLastRun()-id.GetFirstRun()==0) && lastVersion!=0 && (lastRunRange.GetLastRun()-lastRunRange.GetFirstRun()==0)){
+               AliWarning(Form("Not overwriting entry with %s", id.ToString().Data()));
+               return kFALSE;
        }
+
+       id.SetVersion(lastVersion + 1);
        id.SetSubVersion(0);
 
        TString lastStorage = id.GetLastStorage();