From 80b0f85984fe2e22d88f9beeaa2611bdececf080 Mon Sep 17 00:00:00 2001
From: Peter Van Gemmeren <peter.van.gemmeren@cern.ch>
Date: Fri, 2 Sep 2016 17:23:21 +0200
Subject: [PATCH] Resurrect PersToPers copy functionality
 (AthenaPoolCnvSvc-00-29-00)

	* AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc, T_AthenaPoolCustomCnv.icc:
	Resurrect PersToPers copy functionality (to be validated).
	* tag AthenaPoolCnvSvc-00-29-00

2016-08-31  Peter van Gemmeren <gemmeren@anl.gov>
	* src/AthenaPoolCnvSvc.cxx: Disable timing measurements for streaming
	mode (for now, no class name).
	* tag AthenaPoolCnvSvc-00-28-29

2016-08-26  scott snyder  <snyder@bnl.gov>

	* Tagging AthenaPoolCnvSvc-00-28-28.
	* Coverity 111271, 111276, 111278-111279.

2016-08-16  Peter van Gemmeren <gemmeren@anl.gov>
	* python/AthenaPool.py, src/AthenaPoolCnvSvc.cxx: Disable or remove
	some older/obsolete features and settings.
	* tag AthenaPoolCnvSvc-00-28-27

2016-08-09  Peter van Gemmeren <gemmeren@anl.gov>
...
(Long ChangeLog diff - truncated)
---
 .../AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc  | 41 ++++++++++++--
 .../T_AthenaPoolCustomCnv.icc                 | 55 +++++++++++++++++--
 .../AthenaPoolCnvSvc/python/AthenaPool.py     |  6 ++
 .../AthenaPoolCnvSvc/python/ReadAthenaPool.py |  3 +
 .../python/WriteAthenaPool.py                 |  4 +-
 .../share/AthenaPoolCnvSvc_jobOptions.py      |  4 --
 .../src/AthenaAttributeListCnv.cxx            | 20 +++----
 .../AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx | 18 +++---
 .../src/CondAttrListCollCnv.cxx               | 20 +++----
 .../src/CondAttrListVecCnv.cxx                | 20 +++----
 .../test/T_AthenaPoolAuxContainerCnv_test.cxx |  1 +
 .../test/T_AthenaPoolTPCnvCnv_test.cxx        |  1 +
 .../test/T_AthenaPoolViewVectorCnv_test.cxx   |  1 +
 .../test/T_AthenaPoolxAODCnv_test.cxx         |  1 +
 14 files changed, 138 insertions(+), 57 deletions(-)

diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc
index 03ad20bc0f4..23c4a4da19b 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc
@@ -99,19 +99,46 @@ StatusCode T_AthenaPoolCustCnv<TRANS, PERS>::poolToObject(const Token*& token, P
 template <class TRANS, class PERS>
 StatusCode T_AthenaPoolCustCnv<TRANS, PERS>::DataObjectToPool(DataObject* pObj, const std::string& key) {
    const std::string className = ClassName<TRANS>::name();
+   bool skipDHE = false;
    TRANS* obj = 0;
    PERS* persObj = 0;
    SG::fromStorable(pObj, obj);
    if (obj == 0) {
-      ATH_MSG_ERROR("failed to cast to T for class (type/key) " << className << "/" << pObj->name());
-      return(StatusCode::FAILURE);
+      if (pObj->clID() == 1) { 
+         if (pObj->registry() != 0 && pObj->registry()->address() != 0) { 
+            ATH_MSG_DEBUG("Failed to cast DataObject to transient type, doing pers to pers"); 
+            if (!this->compareClassGuid(pool::DbReflex::guid(this->m_classDesc))) { 
+               ATH_MSG_ERROR("Can not evolve schema in pers to pers copy"); 
+               return(StatusCode::FAILURE); 
+            } 
+            if (!poolToObject<PERS>(this->m_i_poolToken, persObj).isSuccess()) { 
+               ATH_MSG_ERROR("Failed to read persistent DataType"); 
+               return(StatusCode::FAILURE); 
+            } 
+         } else { 
+            ATH_MSG_DEBUG("Failed to cast DataObject to transient type, using empty default"); 
+            skipDHE = true; 
+            persObj = new PERS(); 
+         } 
+      } else { 
+         ATH_MSG_ERROR("failed to cast to T for class (type/key) " << className << "/" << pObj->name());
+         return(StatusCode::FAILURE);
+      } 
    } else {
       if (!transToPers(obj, persObj).isSuccess()) {
          ATH_MSG_ERROR("Failed to convert to persistent DataType for class (type/key) " << className << "/" << pObj->name());
          return(StatusCode::FAILURE);
       }
    }
-   return(objectToPool<PERS>(persObj, this->m_o_poolToken, key));
+   const Token* token = 0; 
+   StatusCode status = objectToPool<PERS>(persObj, token, key); 
+   if (skipDHE) { 
+      delete token; token = 0; 
+      this->setToken("\n"); 
+   } else { 
+      this->m_o_poolToken = token; token = 0; 
+   } 
+   return(status); 
 }
 //__________________________________________________________________________
 template <class TRANS, class PERS>
@@ -138,8 +165,12 @@ StatusCode T_AthenaPoolCustCnv<TRANS, PERS>::PoolToDataObject(DataObject*& pObj,
 template <class TRANS, class PERS>
 inline void T_AthenaPoolCustCnv<TRANS, PERS>::setToken(const std::string& token_str) {
    if (this->m_i_poolToken == 0) this->m_i_poolToken = new Token;
-   const_cast<Token*>(this->m_i_poolToken)->fromString(token_str);
-   m_classID = this->m_i_poolToken != 0 ? this->m_i_poolToken->classID() : Guid::null();
+   if (this->m_i_poolToken != 0) {
+      const_cast<Token*>(this->m_i_poolToken)->fromString(token_str);
+      m_classID = this->m_i_poolToken->classID();
+   } else {
+      m_classID = Guid::null();
+   }
 }
 //__________________________________________________________________________
 // Compare POOL class GUID with the one from object being read
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.icc b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.icc
index f05c6cd770a..b982d834bae 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.icc
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.icc
@@ -16,9 +16,7 @@
 
 #include "SGTools/StorableConversions.h"
 
-//#include "TPTools/AthenaConverterTLPExtension.h"
 #include "AthenaPoolCnvTPExtension.h"
-//#include "TPTools/TopLevelTPCnvBase.h"
 
 #include <stdexcept>
 
@@ -29,12 +27,51 @@ T_AthenaPoolCustomCnv<TRANS, PERS>::T_AthenaPoolCustomCnv(ISvcLocator* pSvcLocat
 template <class TRANS, class PERS>
 StatusCode T_AthenaPoolCustomCnv<TRANS, PERS>::DataObjectToPool(DataObject* pObj, const std::string& key) {
    ATH_MSG_VERBOSE("In DataObjectToPool() for key = " << pObj->name());
+   bool skipDHE = false;
    TRANS* obj = 0;
    PERS* persObj = 0;
    SG::fromStorable(pObj, obj);
    if (obj == 0) {
-      ATH_MSG_ERROR("Failed to cast DataObject to transient type");
-      return(StatusCode::FAILURE);
+      if (pObj->clID() == 1) { 
+         if (pObj->registry() != 0 && pObj->registry()->address() != 0) { 
+            const std::string className = ClassName<PERS>::name(); 
+            if (this->m_className != className) { 
+               this->m_className = className; 
+               auto itClass = this->m_classDescs.find(className); 
+               if (itClass == this->m_classDescs.end()) { 
+                  this->m_classDesc = RootType( typeid(PERS) ); 
+                  this->m_classDescs[className] = this->m_classDesc; 
+               } else { 
+                  // Set to correct class description 
+                  this->m_classDesc = (*itClass).second; 
+               } 
+            } 
+            this->setToken(pObj->registry()->address()->par()[0]); 
+            ATH_MSG_DEBUG("Failed to cast DataObject to transient type, doing pers to pers"); 
+            if (!this->compareClassGuid(pool::DbReflex::guid(this->m_classDesc))) { 
+               ATH_MSG_ERROR("Can not evolve schema in pers to pers copy"); 
+               return(StatusCode::FAILURE); 
+            } 
+            AthenaConverterTLPExtension *extCnv = dynamic_cast<AthenaConverterTLPExtension*>(this); 
+            if (extCnv != 0) { 
+               ATH_MSG_ERROR("Can not retrieve " << pObj->name() << " in pers to pers copy"); 
+               return(StatusCode::FAILURE); 
+            } 
+            try { 
+               persObj = this->poolReadObject<PERS>(); 
+            } catch (...) { 
+               ATH_MSG_ERROR("Failed to read persistent DataType"); 
+               return(StatusCode::FAILURE); 
+            } 
+         } else { 
+            ATH_MSG_DEBUG("Failed to cast DataObject to transient type, using empty default"); 
+            skipDHE = true; 
+            persObj = new PERS(); 
+         } 
+      } else { 
+         ATH_MSG_ERROR("Failed to cast DataObject to transient type");
+         return(StatusCode::FAILURE);
+      }
    } else {
       try {
          persObj = createPersistent(obj);
@@ -54,7 +91,15 @@ StatusCode T_AthenaPoolCustomCnv<TRANS, PERS>::DataObjectToPool(DataObject* pObj
       }
    }
    m_persObjList.push_back(persObj);
-   return(this->objectToPool(persObj, this->m_o_poolToken, key));
+   const Token* token = 0; 
+   StatusCode status = this->objectToPool(persObj, token, key); 
+   if (skipDHE) { 
+      delete token; token = 0; 
+      this->setToken("\n"); 
+   } else { 
+      this->m_o_poolToken = token; token = 0; 
+   } 
+   return(status); 
 }
 
 template <class TRANS, class PERS>
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/AthenaPool.py b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/AthenaPool.py
index 849afd896b6..19b1661e2c5 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/AthenaPool.py
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/AthenaPool.py
@@ -27,19 +27,23 @@ def _loadBasicAthenaPool():
     msg.debug( "Loading basic services for AthenaPool..." )
 
     svcMgr += CfgMgr.PoolSvc()
+    svcMgr.PoolSvc.MaxFilesOpen = 3
     #if in AthAnalysisBase, we will set the outputlevel of PoolSvc to ERROR, to silence warnings about missing reflex types
     #detect AthAnalysisBase by looking at the CMTEXTRATAGS env var, if it contains 'ManaCore' then we are in AthAnalysisBase
     import os
     from AthenaCommon.Constants import ERROR
     if "ManaCore" in os.environ.get('CMTEXTRATAGS',""): svcMgr.PoolSvc.OutputLevel=ERROR
+
     svcMgr += CfgMgr.AthenaPoolCnvSvc()
 
+    """
     from AthenaCommon.AppMgr import theApp
     theApp.Dlls += [
         ## FIXME
         # needed: why isn't this guy being picked up through genmap ??
         "DBDataModelAthenaPoolPoolCnv", 
         ]
+    """
 
     if not hasattr (svcMgr, 'EventPersistencySvc'):
         svcMgr += CfgMgr.EvtPersistencySvc( "EventPersistencySvc" )
@@ -47,6 +51,7 @@ def _loadBasicAthenaPool():
     if not hasattr (svcMgr, 'ProxyProviderSvc'):
         svcMgr += CfgMgr.ProxyProviderSvc()
 
+    """
     #
     # Make sure AthenaSealSvc is loaded for dict check
     svcMgr += CfgMgr.AthenaSealSvc()
@@ -57,6 +62,7 @@ def _loadBasicAthenaPool():
 
     # Load streamer allowing conversion of old CLHEP classes
     import AtlasSealCLHEP.OldCLHEPStreamers
+    """
 
     # Add in MetaDataSvc
     svcMgr += CfgMgr.MetaDataSvc( "MetaDataSvc" )
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/ReadAthenaPool.py b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/ReadAthenaPool.py
index 1f7f00c951f..5eeb07eda43 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/ReadAthenaPool.py
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/ReadAthenaPool.py
@@ -32,6 +32,9 @@ def _configureReadAthenaPool():
     # Load the basic services
     import AthenaPoolCnvSvc.AthenaPool
 
+    # Switch off TTreeCache for POOLContainerForm (most of the time only first entry is needed
+    #svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "ContainerName = 'POOLContainerForm'; TREE_CACHE = '0'" ]
+
     # Load ProxyProviderSvc
     if not hasattr (svcMgr, 'ProxyProviderSvc'):
         svcMgr += CfgMgr.ProxyProviderSvc()
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/WriteAthenaPool.py b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/WriteAthenaPool.py
index 3cfabbbedb0..a6416a64c40 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/WriteAthenaPool.py
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/WriteAthenaPool.py
@@ -41,8 +41,8 @@ def _configureWriteAthenaPool():
     svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DEFAULT_BUFFERSIZE = '32000'" ]
 
     # Turn off auto_flush for DataHeader container to avoid basket optimization
-    svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ "ContainerName = 'TTree=POOLContainer'; TREE_AUTO_FLUSH = '0'" ]
-    svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ "ContainerName = 'POOLContainerForm(DataHeaderForm)'; BRANCH_BASKET_SIZE = '256000'" ]
+    svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ "ContainerName = 'POOLContainer(DataHeader)'; BRANCH_BASKET_SIZE = '256000'" ]
+    svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ "ContainerName = 'POOLContainerForm(DataHeaderForm)'; BRANCH_BASKET_SIZE = '1024000'" ]
     svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ "ContainerName = 'TTree=POOLContainerForm(DataHeaderForm)'; CONTAINER_SPLITLEVEL = '99'" ]
 
     svcMgr.AthenaPoolCnvSvc.PoolContainerPrefix = "CollectionTree"
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/share/AthenaPoolCnvSvc_jobOptions.py b/Database/AthenaPOOL/AthenaPoolCnvSvc/share/AthenaPoolCnvSvc_jobOptions.py
index 4041c5b35d6..d9359998088 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/share/AthenaPoolCnvSvc_jobOptions.py
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/share/AthenaPoolCnvSvc_jobOptions.py
@@ -64,10 +64,6 @@ svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "ContainerName = '<treeName>';
 svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '<fileName>'; ContainerName = '<type>/<key>'; <attributeName> = '<dataType>'" ]
 
 svcMgr.AthenaPoolCnvSvc.PoolAttributes = [ ]
-# Number of events to process with commitAndHold, before doing a full commit.
-# -1 -> only do full commit at end of job
-#  0 -> always do a full commit
-svcMgr.AthenaPoolCnvSvc.CommitInterval = 0
 
 ## backward compat
 AthenaPoolCnvSvc = svcMgr.AthenaPoolCnvSvc
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaAttributeListCnv.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaAttributeListCnv.cxx
index 505c4cae310..afecd2f1013 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaAttributeListCnv.cxx
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaAttributeListCnv.cxx
@@ -33,12 +33,12 @@ AthenaAttributeListCnv::~AthenaAttributeListCnv() {
 }
 //__________________________________________________________________________
 StatusCode AthenaAttributeListCnv::initialize() {
-   MsgStream log(messageService(), "AthenaAttributeListCnv");
+   MsgStream log(msgSvc(), "AthenaAttributeListCnv");
 
-   log << MSG::DEBUG << "initialize() in AthenaAttributeListCnv" << endreq;
+   log << MSG::DEBUG << "initialize() in AthenaAttributeListCnv" << endmsg;
    StatusCode status = Converter::initialize();
    if (!status.isSuccess()) {
-      log << MSG::ERROR << "Can not initialize Converter base class." << endreq;
+      log << MSG::ERROR << "Can not initialize Converter base class." << endmsg;
       return(status);
    }
    return(status);
@@ -50,8 +50,8 @@ StatusCode AthenaAttributeListCnv::createObj(IOpaqueAddress* pAddr, DataObject*&
     // extract an AthenaAttributeList pointer from an
     // AthenaAttrListAddress and return it
 
-    MsgStream log(messageService(), "AthenaAttributeListCnv");
-    log << MSG::DEBUG << "Creating AthenaAttrListAddress Object" << endreq;
+    MsgStream log(msgSvc(), "AthenaAttributeListCnv");
+    log << MSG::DEBUG << "Creating AthenaAttrListAddress Object" << endmsg;
 
     AthenaAttrListAddress* addr = dynamic_cast<AthenaAttrListAddress*>(pAddr);
 
@@ -59,11 +59,11 @@ StatusCode AthenaAttributeListCnv::createObj(IOpaqueAddress* pAddr, DataObject*&
 	// Successful cast
 	pObj = SG::asStorable(addr->attrList());
 	if (!pObj) {
-	    log << MSG::ERROR << "AttributeList ptr is 0 from AthenaAttrListAddress " << endreq;
+	    log << MSG::ERROR << "AttributeList ptr is 0 from AthenaAttrListAddress " << endmsg;
 	    return(StatusCode::FAILURE);       
 	}
     } else {
-	log << MSG::ERROR << "Could not extract ptr for AthenaAttrListAddress " << endreq;
+	log << MSG::ERROR << "Could not extract ptr for AthenaAttrListAddress " << endmsg;
 	return(StatusCode::FAILURE);       
     }
 
@@ -76,8 +76,8 @@ StatusCode AthenaAttributeListCnv::createRep(DataObject* pObj, IOpaqueAddress*&
     // create an AthenaAttrListAddress and fill it with a pointer to
     // the AthenaAttributeList
 
-    MsgStream log(messageService(), "AthenaAttributeListCnv");
-    log << MSG::DEBUG << "Copy AthenaAttributeList ptr into AthenaAttrListAddress" << endreq;
+    MsgStream log(msgSvc(), "AthenaAttributeListCnv");
+    log << MSG::DEBUG << "Copy AthenaAttributeList ptr into AthenaAttrListAddress" << endmsg;
 
     AthenaAttributeList* list = 0; //dynamic_cast<AthenaAttributeList*>(pObj);
     SG::fromStorable(pObj, list);
@@ -87,7 +87,7 @@ StatusCode AthenaAttributeListCnv::createRep(DataObject* pObj, IOpaqueAddress*&
     addr->setAttrList(list);
     pAddr = addr;
 
-    log << MSG::DEBUG << "Created AthenaAttrListAddress with list ptr: " << list << endreq;
+    log << MSG::DEBUG << "Created AthenaAttrListAddress with list ptr: " << list << endmsg;
     return(StatusCode::SUCCESS);
 }
 //__________________________________________________________________________
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx
index 62c4e88ad60..0d1e6ddc9a6 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx
@@ -46,14 +46,6 @@ StatusCode AthenaPoolCnvSvc::initialize() {
       ATH_MSG_FATAL("Cannot get DataModelCompatSvc.");
       return(StatusCode::FAILURE);
    }
-#if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
-   // Initialize AthenaRootStreamerSvc
-   ServiceHandle<IService> arssvc("AthenaRootStreamerSvc", this->name());
-   if (!arssvc.retrieve().isSuccess()) {
-      ATH_MSG_FATAL("Cannot get AthenaRootStreamerSvc.");
-      return(StatusCode::FAILURE);
-   }
-#endif
    // Retrieve PoolSvc
    if (!m_poolSvc.retrieve().isSuccess()) {
       ATH_MSG_FATAL("Cannot get PoolSvc.");
@@ -407,6 +399,7 @@ StatusCode AthenaPoolCnvSvc::commitOutput(const std::string& /*outputConnectionS
                IConverter* cnv = converter(ClassID_traits<DataHeader>::ID());
                if (!cnv->updateRepRefs(&address, (DataObject*)obj).isSuccess()) {
                   ATH_MSG_ERROR("Failed updateRepRefs for obj = " << token->toString());
+                  delete token; token = 0;
                   return(StatusCode::FAILURE);
                }
             }
@@ -417,6 +410,7 @@ StatusCode AthenaPoolCnvSvc::commitOutput(const std::string& /*outputConnectionS
                IConverter* cnv = converter(ClassID_traits<DataHeader>::ID());
                if (!cnv->updateRep(&address, (DataObject*)obj).isSuccess()) {
                   ATH_MSG_ERROR("Failed updateRep for obj = " << token->toString());
+                  delete token; token = 0;
                   return(StatusCode::FAILURE);
                }
             }
@@ -465,7 +459,7 @@ StatusCode AthenaPoolCnvSvc::commitOutput(const std::string& /*outputConnectionS
    }
    static int commitCounter = 1;
    try {
-      if ((commitCounter > m_commitInterval && m_commitInterval > 0) || doCommit) {
+      if (/*(commitCounter > m_commitInterval && m_commitInterval > 0) || */doCommit) {
          commitCounter = 1;
          if (!m_poolSvc->commit(IPoolSvc::kOutputStream).isSuccess()) {
             ATH_MSG_ERROR("commitOutput FAILED to commit OutputStream.");
@@ -503,8 +497,10 @@ StatusCode AthenaPoolCnvSvc::commitOutput(const std::string& /*outputConnectionS
    if (m_useDetailChronoStat.value()) {
       m_chronoStatSvc->chronoStop("commitOutput");
    }
-   // prepare chrono for next commit
-   m_doChronoStat = true;
+   // prepare chrono for next commit, keep disabled for streaming mode
+   if (m_inputStreamingTool.empty() && m_outputStreamingTool.empty()) {
+      m_doChronoStat = true;
+   }
    return(StatusCode::SUCCESS);
 }
 //______________________________________________________________________________
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/CondAttrListCollCnv.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/CondAttrListCollCnv.cxx
index 0caf95a6e28..cd7eb48b796 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/CondAttrListCollCnv.cxx
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/CondAttrListCollCnv.cxx
@@ -33,12 +33,12 @@ CondAttrListCollCnv::~CondAttrListCollCnv() {
 }
 //__________________________________________________________________________
 StatusCode CondAttrListCollCnv::initialize() {
-   MsgStream log(messageService(), "CondAttrListCollCnv");
+   MsgStream log(msgSvc(), "CondAttrListCollCnv");
 
-   log << MSG::DEBUG << "initialize() in CondAttrListCollCnv" << endreq;
+   log << MSG::DEBUG << "initialize() in CondAttrListCollCnv" << endmsg;
    StatusCode status = Converter::initialize();
    if (!status.isSuccess()) {
-      log << MSG::ERROR << "Can not initialize Converter base class." << endreq;
+      log << MSG::ERROR << "Can not initialize Converter base class." << endmsg;
       return(status);
    }
    return(status);
@@ -50,8 +50,8 @@ StatusCode CondAttrListCollCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pO
     // we only extract an CondAttrListCollection pointer from an
     // CondAttrListCollAddress and return it
 
-    MsgStream log(messageService(), "CondAttrListCollCnv");
-    log << MSG::DEBUG << "Creating CondAttrListCollAddress Object" << endreq;
+    MsgStream log(msgSvc(), "CondAttrListCollCnv");
+    log << MSG::DEBUG << "Creating CondAttrListCollAddress Object" << endmsg;
 
     CondAttrListCollAddress* addr = dynamic_cast<CondAttrListCollAddress*>(pAddr);
 
@@ -59,12 +59,12 @@ StatusCode CondAttrListCollCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pO
 	// Successful cast
 	pObj = SG::asStorable(addr->attrListColl());
 	if (!pObj) {
-	    log << MSG::ERROR << "CondAttrListCollection ptr is 0 from CondAttrListCollAddress " << endreq;
+	    log << MSG::ERROR << "CondAttrListCollection ptr is 0 from CondAttrListCollAddress " << endmsg;
 	    return(StatusCode::FAILURE);       
 	}
     }
     else {
-	log << MSG::ERROR << "Could not extract ptr for CondAttrListCollAddress " << endreq;
+	log << MSG::ERROR << "Could not extract ptr for CondAttrListCollAddress " << endmsg;
 	return(StatusCode::FAILURE);       
     }
 
@@ -77,8 +77,8 @@ StatusCode CondAttrListCollCnv::createRep(DataObject* pObj, IOpaqueAddress*& pAd
     // we only create an CondAttrListCollAddress and fill it with a
     // pointer to the CondAttrListCollection
 
-    MsgStream log(messageService(), "CondAttrListCollCnv");
-    log << MSG::DEBUG << "Copy CondAttrListCollection ptr into CondAttrListCollAddress" << endreq;
+    MsgStream log(msgSvc(), "CondAttrListCollCnv");
+    log << MSG::DEBUG << "Copy CondAttrListCollection ptr into CondAttrListCollAddress" << endmsg;
 
     CondAttrListCollection* list = 0; //dynamic_cast<CondAttrListCollection*>(pObj);
     SG::fromStorable(pObj, list);
@@ -88,7 +88,7 @@ StatusCode CondAttrListCollCnv::createRep(DataObject* pObj, IOpaqueAddress*& pAd
     addr->setAttrListColl(list);
     pAddr = addr;
 
-    log << MSG::DEBUG << "Created CondAttrListCollAddress with list ptr: " << list << endreq;
+    log << MSG::DEBUG << "Created CondAttrListCollAddress with list ptr: " << list << endmsg;
     return(StatusCode::SUCCESS);
 }
 //__________________________________________________________________________
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/CondAttrListVecCnv.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/CondAttrListVecCnv.cxx
index 1f71c6f3497..80155c90e8b 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/CondAttrListVecCnv.cxx
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/CondAttrListVecCnv.cxx
@@ -32,12 +32,12 @@ CondAttrListVecCnv::~CondAttrListVecCnv() {
 }
 //__________________________________________________________________________
 StatusCode CondAttrListVecCnv::initialize() {
-   MsgStream log(messageService(), "CondAttrListVecCnv");
+   MsgStream log(msgSvc(), "CondAttrListVecCnv");
 
-   log << MSG::DEBUG << "initialize() in CondAttrListVecCnv" << endreq;
+   log << MSG::DEBUG << "initialize() in CondAttrListVecCnv" << endmsg;
    StatusCode status = Converter::initialize();
    if (!status.isSuccess()) {
-      log << MSG::ERROR << "Can not initialize Converter base class." << endreq;
+      log << MSG::ERROR << "Can not initialize Converter base class." << endmsg;
       return(status);
    }
    return(status);
@@ -49,8 +49,8 @@ StatusCode CondAttrListVecCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pOb
     // extract an AthenaAttributeList pointer from an
     // AthenaAttrListAddress and return it
 
-    MsgStream log(messageService(), "CondAttrListVecCnv");
-    log << MSG::DEBUG << "Creating CondAttrListVecAddress Object" << endreq;
+    MsgStream log(msgSvc(), "CondAttrListVecCnv");
+    log << MSG::DEBUG << "Creating CondAttrListVecAddress Object" << endmsg;
 
     CondAttrListVecAddress* addr = dynamic_cast<CondAttrListVecAddress*>(pAddr);
 
@@ -58,11 +58,11 @@ StatusCode CondAttrListVecCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pOb
 	// Successful cast
 	pObj = SG::asStorable(addr->attrListVec());
 	if (!pObj) {
-	    log << MSG::ERROR << "CondAttrListVec ptr is 0 from CondAttrListVecAddress " << endreq;
+	    log << MSG::ERROR << "CondAttrListVec ptr is 0 from CondAttrListVecAddress " << endmsg;
 	    return(StatusCode::FAILURE);       
 	}
     } else {
-	log << MSG::ERROR << "Could not extract ptr for CondAttrListVecAddress " << endreq;
+	log << MSG::ERROR << "Could not extract ptr for CondAttrListVecAddress " << endmsg;
 	return(StatusCode::FAILURE);       
     }
 
@@ -75,8 +75,8 @@ StatusCode CondAttrListVecCnv::createRep(DataObject* pObj, IOpaqueAddress*& pAdd
     // create an AthenaAttrListAddress and fill it with a pointer to
     // the AthenaAttributeList
 
-    MsgStream log(messageService(), "CondAttrListVecCnv");
-    log << MSG::DEBUG << "Copy CondAttrListVec ptr into CondAttrListVecAddress" << endreq;
+    MsgStream log(msgSvc(), "CondAttrListVecCnv");
+    log << MSG::DEBUG << "Copy CondAttrListVec ptr into CondAttrListVecAddress" << endmsg;
 
     CondAttrListVec* list = 0; //dynamic_cast<AthenaAttributeList*>(pObj);
     SG::fromStorable(pObj, list);
@@ -85,7 +85,7 @@ StatusCode CondAttrListVecCnv::createRep(DataObject* pObj, IOpaqueAddress*& pAdd
 		    "POOLContainer_CondAttrListVec][CLID=x");
     addr->setAttrListVec(list);
     pAddr = addr;
-    log << MSG::DEBUG << "Created CondAttrListVec with list ptr: " << list << endreq;
+    log << MSG::DEBUG << "Created CondAttrListVec with list ptr: " << list << endmsg;
     return(StatusCode::SUCCESS);
 }
 //__________________________________________________________________________
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolAuxContainerCnv_test.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolAuxContainerCnv_test.cxx
index 24605568a7d..aca58b913ec 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolAuxContainerCnv_test.cxx
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolAuxContainerCnv_test.cxx
@@ -258,6 +258,7 @@ int main()
 
   TestCnvSvc* svc = new TestCnvSvc ("AthenaPoolCnvSvc", pSvcLoc);
   ISvcManager* mgr = dynamic_cast<ISvcManager*> (pSvcLoc);
+  if (!mgr) std::abort();
   if (mgr->addService (svc).isFailure())
     std::abort();
   
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolTPCnvCnv_test.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolTPCnvCnv_test.cxx
index c31154526fa..aec0791000a 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolTPCnvCnv_test.cxx
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolTPCnvCnv_test.cxx
@@ -216,6 +216,7 @@ int main()
 
   TestCnvSvc* svc = new TestCnvSvc ("AthenaPoolCnvSvc", pSvcLoc);
   ISvcManager* mgr = dynamic_cast<ISvcManager*> (pSvcLoc);
+  if (!mgr) std::abort();
   if (mgr->addService (svc).isFailure())
     std::abort();
   
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolViewVectorCnv_test.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolViewVectorCnv_test.cxx
index bb4eb0acf78..e8eacc3d401 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolViewVectorCnv_test.cxx
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolViewVectorCnv_test.cxx
@@ -175,6 +175,7 @@ int main()
 
   TestCnvSvc* svc = new TestCnvSvc ("AthenaPoolCnvSvc", pSvcLoc);
   ISvcManager* mgr = dynamic_cast<ISvcManager*> (pSvcLoc);
+  if (!mgr) std::abort();
   if (mgr->addService (svc).isFailure())
     std::abort();
   
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolxAODCnv_test.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolxAODCnv_test.cxx
index fd5216ce376..9a4b988be9f 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolxAODCnv_test.cxx
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolxAODCnv_test.cxx
@@ -151,6 +151,7 @@ int main()
 
   TestCnvSvc* svc = new TestCnvSvc ("AthenaPoolCnvSvc", pSvcLoc);
   ISvcManager* mgr = dynamic_cast<ISvcManager*> (pSvcLoc);
+  if (!mgr) std::abort();
   if (mgr->addService (svc).isFailure())
     std::abort();
   
-- 
GitLab