From bc2d4295a14efae70a127a8223e6ac77210939b5 Mon Sep 17 00:00:00 2001
From: scott snyder <scott.snyder@cern.ch>
Date: Thu, 20 Apr 2017 18:05:13 +0200
Subject: [PATCH] StoreGate: symlink/alias support for hive.

Tell hive about entries made with addSymLink and addAlias.
Extend addedNewPersObject to also tell hive about symlinks and aliases.
---
 Control/StoreGate/src/SGImplSvc.cxx | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/Control/StoreGate/src/SGImplSvc.cxx b/Control/StoreGate/src/SGImplSvc.cxx
index b49902703a60..5603a653d126 100644
--- a/Control/StoreGate/src/SGImplSvc.cxx
+++ b/Control/StoreGate/src/SGImplSvc.cxx
@@ -714,6 +714,8 @@ SGImplSvc::addSymLink(const CLID& linkid, DataProxy* dp)
     if (baseptr)
       this->t2pRegister (baseptr, dp).ignore();
   }
+
+  addedNewTransObject (linkid, dp->name());
   return sc;
 }
 
@@ -728,6 +730,8 @@ SGImplSvc::addAlias(const std::string& aliasKey, DataProxy* proxy)
     return StatusCode::FAILURE;
   }
 
+  addedNewTransObject (proxy->clID(), aliasKey);
+
   // add key to proxy and to ProxyStore
   return m_pStore->addAlias(aliasKey, proxy);
 }
@@ -1642,7 +1646,19 @@ void SGImplSvc::addedNewPersObject(CLID clid, DataProxy* dp) {
   //if proxy is loading from persistency
   //add key of object to list of "newly recorded" objects
   if (0 != dp->transientAddress()->provider()) {
+    // The object itself.
     s_newObjs.insert(DataObjID(clid,dp->name()));
+
+    // Aliases.
+    for (const std::string& alias : dp->alias()) {
+      s_newObjs.insert(DataObjID(clid,alias));
+    }
+
+    // Symlinks.
+    for (CLID clid2 : dp->transientAddress()->transientID()) {
+      if (clid2 != clid)
+        s_newObjs.insert(DataObjID(clid2,dp->name()));
+    }
   }
 }
 void SGImplSvc::addedNewTransObject(CLID clid, const std::string& key) {
-- 
GitLab