12#include "GaudiKernel/IIoComponentMgr.h"
13#include "GaudiKernel/ConcurrencyFlags.h"
17#include "CoralKernel/Context.h"
34#include "RelationalAccess/ConnectionService.h"
35#include "RelationalAccess/IConnectionServiceConfiguration.h"
36#include "RelationalAccess/IWebCacheControl.h"
37#include "RelationalAccess/IWebCacheInfo.h"
38#include "RelationalAccess/ILookupService.h"
39#include "RelationalAccess/IDatabaseServiceSet.h"
40#include "RelationalAccess/IDatabaseServiceDescription.h"
50 return !s.empty() && (std::isdigit(s[0]) || s[0] ==
'+' || s[0] ==
'-');
64 if (catalog.starts_with(
"xmlcatalog_file:")) {
65 const std::string fileName = catalog.substr(16);
66 if (!iomgr->io_register(
this, IIoComponentMgr::IoMode::READ, fileName, fileName).isSuccess()) {
67 ATH_MSG_FATAL(
"could not register [" << catalog <<
"] for input !");
70 ATH_MSG_INFO(
"io_register[" << this->name() <<
"](" << catalog <<
") [ok]");
76 if (!iomgr->io_register(
this, IIoComponentMgr::IoMode::WRITE, fileName, fileName).isSuccess()) {
84 return(StatusCode::FAILURE);
89 return(StatusCode::FAILURE);
91 coral::ConnectionService conSvcH;
92 coral::IConnectionServiceConfiguration& csConfig = conSvcH.configuration();
96 csConfig.enablePoolAutomaticCleanUp();
99 csConfig.disablePoolAutomaticCleanUp();
100 csConfig.setConnectionTimeOut(0);
102 ATH_MSG_INFO(
"Set connectionsvc retry/timeout/IDLE timeout to "
108 <<
" seconds with connection cleanup "
109 << (csConfig.isPoolAutomaticCleanUpEnabled() ?
"enabled" :
"disabled"));
111 coral::IWebCacheControl& webCache = conSvcH.webCacheControl();
113 ATH_MSG_INFO(
"Frontier compression level set to " << webCache.compressionLevel());
114 MSG::Level athLvl =
msg().level();
124 if (!iomgr.retrieve().isSuccess()) {
126 return(StatusCode::FAILURE);
128 if (!iomgr->io_hasitem(
this)) {
129 ATH_MSG_FATAL(
"IoComponentMgr does not know about myself !");
130 return(StatusCode::FAILURE);
133 for (std::size_t icat = 0,
imax = readcat.size(); icat <
imax; icat++) {
134 if (readcat[icat].compare(0, 16,
"xmlcatalog_file:") == 0) {
135 std::string fileName = readcat[icat].substr(16);
136 if (iomgr->io_contains(
this, fileName)) {
137 if (!iomgr->io_retrieve(
this, fileName).isSuccess()) {
138 ATH_MSG_FATAL(
"Could not retrieve new value for [" << fileName <<
"] !");
139 return(StatusCode::FAILURE);
141 readcat[icat] =
"xmlcatalog_file:" + fileName;
147 if (
m_writeCatalog.value().compare(0, 16,
"xmlcatalog_file:") == 0) {
149 if (iomgr->io_contains(
this, fileName)) {
150 if (!iomgr->io_retrieve(
this, fileName).isSuccess()) {
151 ATH_MSG_FATAL(
"Could not retrieve new value for [" << fileName <<
"] !");
152 return(StatusCode::FAILURE);
170 return(StatusCode::FAILURE);
176 ATH_MSG_FATAL(
"Failed to enable thread safety in ROOT via PersistencySvc.");
177 return(StatusCode::FAILURE);
182 return(StatusCode::FAILURE);
187 return(StatusCode::SUCCESS);
192 if (
m_useROOTIMT && Gaudi::Concurrency::ConcurrencyFlags::numThreads() > 1) {
194 ATH_MSG_FATAL(
"Failed to enable implicit multithreading in ROOT via PersistencySvc.");
195 return(StatusCode::FAILURE);
197 ATH_MSG_INFO(
"Enabled implicit multithreading in ROOT via PersistencySvc to: " << Gaudi::Concurrency::ConcurrencyFlags::numThreads() - 1);
199 return(StatusCode::SUCCESS);
204 bool retError =
false;
211 return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS);
222 for (
const auto& persistencyMutex :
m_pers_mut) {
223 delete persistencyMutex;
237 return(::AthService::finalize());
249 return(StatusCode::SUCCESS);
256 const std::string& auxString = placement->
auxString();
257 if (!auxString.empty()) {
258 if (auxString.compare(0, 6,
"[CTXT=") == 0) {
259 ::sscanf(auxString.c_str(),
"[CTXT=%08X]", &contextId);
260 }
else if (auxString.compare(0, 8,
"[CLABEL=") == 0) {
264 ATH_MSG_WARNING(
"registerForWrite: Using default output Stream instead of id = " << contextId);
270 if (token ==
nullptr) {
278 const std::string& auxString = token->
auxString();
279 if (!auxString.empty()) {
280 if (auxString.compare(0, 6,
"[CTXT=") == 0) {
281 ::sscanf(auxString.c_str(),
"[CTXT=%08X]", &contextId);
282 }
else if (auxString.compare(0, 8,
"[CLABEL=") == 0) {
286 ATH_MSG_WARNING(
"setObjPtr: Using default input Stream instead of id = " << contextId);
290 ATH_MSG_VERBOSE(
"setObjPtr: token=" << token->
toString() <<
", auxString=" << auxString <<
", contextID=" << contextId);
294 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
296 m_guidLists[contextId].remove(token->
dbID());
297 m_guidLists[contextId].push_back(token->
dbID());
298 while (m_guidLists[contextId].
size() > maxFileIter->second) {
299 this->
disconnectDb(
"FID:" + m_guidLists[contextId].begin()->toString(), contextId).ignore();
315 return(contextIter->second);
326 if (!
label.empty()) {
332 return(contextIter->second);
338 if (!
connect(Io::READ,
id).isSuccess()) {
342 if (!
label.empty()) {
385 if (token.compare(0, 4,
"PFN:") == 0) {
387 }
else if (token.compare(0, 4,
"LFN:") == 0) {
388 dbID =
m_catalog->lookupLFN(token.substr(4));
389 }
else if (token.compare(0, 4,
"FID:") == 0) {
390 dbID = token.substr(4);
402 std::string dbID,
type;
417 const std::string& collectionName,
419 unsigned int contextId)
const {
421 <<
", name=" << collectionName <<
", contextID=" << contextId);
423 ATH_MSG_WARNING(
"createCollection: Using default input Stream instead of id = " << contextId);
428 bool insertFile =
false;
429 if (connection.compare(0, 4,
"PFN:") == 0) {
430 std::string fid, fileType;
431 m_catalog->lookupFileByPFN(connection.substr(4), fid, fileType);
434 ATH_MSG_INFO(
"File is not in Catalog! Attempt to open it anyway.");
439 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
440 if (dbH ==
nullptr) {
441 ATH_MSG_INFO(
"Failed to get Session/DatabaseHandle to create POOL collection.");
445 if (dbH->openMode() == Io::INVALID) {
446 dbH->connectForRead();
448 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
449 if (maxFileIter !=
m_contextMaxFile.end() && maxFileIter->second > 0 && !dbH->fid().empty()) {
450 const Guid guid(dbH->fid());
451 m_guidLists[contextId].remove(guid);
452 m_guidLists[contextId].push_back(guid);
453 while (m_guidLists[contextId].
size() > maxFileIter->second + 1) {
454 this->
disconnectDb(
"FID:" + m_guidLists[contextId].begin()->toString(), contextId).ignore();
457 }
catch (std::exception& e) {
458 ATH_MSG_INFO(
"Failed to open container to check POOL collection - trying.");
468 std::string error_text;
470 collPtr = collSvc.open(collectionName, collectionType, connection,
m_dbSessionVec[contextId]);
471 }
catch (std::exception &e) {
473 error_text = e.what();
476 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
477 if (dbH !=
nullptr && !dbH->fid().empty()) {
480 throw std::runtime_error(
"Failed to open Collection: " + error_text +
", PoolSvc::createCollection");
483 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
484 if (dbH ==
nullptr) {
486 }
else if (dbH->fid().empty()) {
487 ATH_MSG_INFO(
"Cannot retrieve the FID of an existing POOL database: '"
488 << connection <<
"' - FileCatalog will NOT be updated.");
507 std::string fid = dbH.
fid();
509 catalog_locked->registerPFN(pfn,
"ROOT_All", fid);
513 const std::string& collection,
514 const unsigned long ientry)
const {
517 if (dbH ==
nullptr) {
520 if (dbH->openMode() == Io::INVALID) {
521 dbH->connectForRead();
524 if (contH ==
nullptr) {
527 auto tokenIter = std::unique_ptr<pool::ITokenIterator>(contH->tokens());
529 return tokenIter->seek(ientry)? tokenIter->next() :
nullptr;
533 if (
type != Io::READ) {
535 ATH_MSG_WARNING(
"connect: Using default output Stream instead of id = " << contextId);
540 ATH_MSG_WARNING(
"connect: Using default input Stream instead of id = " << contextId);
543 ATH_MSG_INFO(
"Connecting to InputStream for: " << contextId);
548 return(StatusCode::FAILURE);
553 if (session->transaction().isActive()) {
554 return(StatusCode::SUCCESS);
556 if (!session->start(
type)) {
558 return(StatusCode::FAILURE);
561 return(StatusCode::SUCCESS);
566 return(StatusCode::FAILURE);
570 if (session !=
nullptr && session->transaction().isActive()) {
571 if (!session->commit()) {
573 return(StatusCode::FAILURE);
575 if (session->transaction().type() == Io::READ) {
576 session->disconnectAll();
579 return(StatusCode::SUCCESS);
584 return(StatusCode::FAILURE);
591 return(StatusCode::FAILURE);
594 return(StatusCode::SUCCESS);
598 ATH_MSG_DEBUG(
"Disconnect request for contextId=" << contextId);
600 return(StatusCode::SUCCESS);
605 if (!
commit(contextId).isSuccess()) {
607 return(StatusCode::FAILURE);
612 ATH_MSG_ERROR(
"disconnect failed to diconnect PersistencySvc");
613 return(StatusCode::FAILURE);
616 return(StatusCode::SUCCESS);
621 return(StatusCode::SUCCESS);
624 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
625 if (dbH ==
nullptr) {
627 return(StatusCode::FAILURE);
629 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
631 m_guidLists[contextId].remove(
Guid(dbH->fid()));
634 return(StatusCode::SUCCESS);
640 unsigned int contextId)
const {
642 ATH_MSG_WARNING(
"getAttribute: Using default input Stream instead of id = " << contextId);
647 std::ostringstream oss;
648 if (data ==
"DbLonglong") {
650 }
else if (data ==
"double") {
656 ATH_MSG_INFO(
"Domain attribute [" << optName <<
"]" <<
": " << data);
657 return(StatusCode::SUCCESS);
663 const std::string& dbName,
664 const std::string& contName,
665 unsigned int contextId)
const {
667 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
668 if (dbH ==
nullptr) {
669 ATH_MSG_DEBUG(
"getAttribute: Failed to get Session/DatabaseHandle to get POOL property.");
670 return(StatusCode::FAILURE);
672 if (dbH->openMode() == Io::INVALID) {
674 dbH->setTechnology(tech);
675 dbH->connectForWrite();
677 dbH->connectForRead();
680 std::ostringstream oss;
681 if (contName.empty()) {
682 if (data ==
"DbLonglong") {
683 oss << std::dec << dbH->technologySpecificAttributes().attribute<
long long int>(optName);
684 }
else if (data ==
"double") {
685 oss << std::dec << dbH->technologySpecificAttributes().attribute<
double>(optName);
686 }
else if (data ==
"string") {
687 oss << dbH->technologySpecificAttributes().attribute<
char*>(optName);
689 oss << std::dec << dbH->technologySpecificAttributes().attribute<
int>(optName);
691 ATH_MSG_INFO(
"Database (" << dbH->pfn() <<
") attribute [" << optName <<
"]" <<
": " << oss.str());
694 if (contH ==
nullptr) {
695 ATH_MSG_DEBUG(
"Failed to get ContainerHandle to get POOL property.");
696 return(StatusCode::FAILURE);
698 if (data ==
"DbLonglong") {
699 oss << std::dec << contH->technologySpecificAttributes().attribute<
long long int>(optName);
700 }
else if (data ==
"double") {
701 oss << std::dec << contH->technologySpecificAttributes().attribute<
double>(optName);
703 oss << std::dec << contH->technologySpecificAttributes().attribute<
int>(optName);
705 ATH_MSG_INFO(
"Container attribute [" << contName <<
"." << optName <<
"]: " << oss.str());
708 return(StatusCode::SUCCESS);
712 const std::string& data,
714 unsigned int contextId)
const {
716 ATH_MSG_WARNING(
"setAttribute: Using default output Stream instead of id = " << contextId);
721 if (data[data.size() - 1] ==
'L') {
723 ATH_MSG_DEBUG(
"Failed to set POOL property, " << optName <<
" to " << data);
724 return(StatusCode::FAILURE);
728 ATH_MSG_DEBUG(
"Failed to set POOL property, " << optName <<
" to " << data);
729 return(StatusCode::FAILURE);
732 return(StatusCode::SUCCESS);
736 const std::string& data,
738 const std::string& dbName,
739 const std::string& contName,
740 unsigned int contextId)
const {
742 ATH_MSG_WARNING(
"setAttribute: Using default output Stream instead of id = " << contextId);
746 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
747 if (dbH ==
nullptr) {
748 ATH_MSG_DEBUG(
"Failed to get Session/DatabaseHandle to set POOL property.");
749 return(StatusCode::FAILURE);
751 if (dbH->openMode() == Io::INVALID) {
753 dbH->setTechnology(tech);
754 dbH->connectForWrite();
756 dbH->connectForRead();
759 bool retError =
false;
761 bool hasTTreeName = (contName.length() > 6 && contName.compare(0, 6,
"TTree=") == 0);
762 if (contName.empty() || hasTTreeName ||
m_dbSessionVec[contextId]->transaction().type() == Io::READ) {
763 objName = hasTTreeName ? contName.substr(6) : contName;
765 retError = dbH->technologySpecificAttributes().setAttribute(optName, data.c_str(), objName);
766 }
else if( data[data.size() - 1] ==
'L' ) {
767 retError = dbH->technologySpecificAttributes().setAttribute<
long long int>(optName, atoll(data.c_str()), objName);
769 retError = dbH->technologySpecificAttributes().setAttribute<
int>(optName, atoi(data.c_str()), objName);
772 ATH_MSG_DEBUG(
"Failed to set POOL property, " << optName <<
" to " << data);
773 return(StatusCode::FAILURE);
777 if (contH ==
nullptr) {
778 ATH_MSG_DEBUG(
"Failed to get ContainerHandle to set POOL property.");
779 return(StatusCode::FAILURE);
781 if (
auto p = contName.find(
'('); p != std::string::npos) {
782 objName = contName.substr(p + 1);
783 objName.erase(objName.find(
')'));
784 }
else if (
auto p = contName.find(
"::"); p != std::string::npos) {
785 objName = contName.substr(p + 2);
786 }
else if (
auto p = contName.find(
'_'); p != std::string::npos) {
787 objName = contName.substr(p + 1);
788 objName.erase(objName.find(
'/'));
790 std::string::size_type off = 0;
791 while ((off = objName.find_first_of(
"<>/")) != std::string::npos) {
794 if (data[data.size() - 1] ==
'L') {
795 retError = contH->technologySpecificAttributes().setAttribute<
long long int>(optName, atoll(data.c_str()), objName);
797 retError = contH->technologySpecificAttributes().setAttribute<
int>(optName, atoi(data.c_str()), objName);
800 ATH_MSG_DEBUG(
"Failed to set POOL container property, " << optName <<
" for " << contName <<
" : " << objName <<
" to " << data);
801 return(StatusCode::FAILURE);
804 return(StatusCode::SUCCESS);
812 std::vector<std::string> physcons;
813 if (conn.find(
':') == std::string::npos) {
816 const std::string lookSvcStr(
"CORAL/Services/XMLLookupService");
817 coral::IHandle<coral::ILookupService> lookSvcH =
m_context->query<coral::ILookupService>();
818 if (!lookSvcH.isValid()) {
820 lookSvcH =
m_context->query<coral::ILookupService>();
822 if (!lookSvcH.isValid()) {
824 return(StatusCode::FAILURE);
826 coral::IDatabaseServiceSet* dbset = lookSvcH->lookup(conn, coral::ReadOnly);
827 if (dbset !=
nullptr) {
828 for (
int irep = 0, nrep = dbset->numberOfReplicas(); irep < nrep; ++irep) {
829 const std::string pcon = dbset->replica(irep).connectionString();
830 if (pcon.compare(0, 9,
"frontier:") == 0) {
831 physcons.push_back(std::move(pcon));
834 delete dbset; dbset =
nullptr;
836 ATH_MSG_DEBUG(
"setFrontierCache: Could not find any replicas for " << conn);
838 }
else if (conn.compare(0, 9,
"frontier:") == 0) {
839 physcons.push_back(conn);
842 if (physcons.size() == 0) {
843 return(StatusCode::SUCCESS);
845 coral::ConnectionService conSvcH;
849 coral::IWebCacheControl& webCache = conSvcH.webCacheControl();
850 for (
const auto& physcon : physcons) {
852 if (std::find(refreshList.begin(), refreshList.end(), physcon) == refreshList.end()
853 && std::find(refreshList.begin(), refreshList.end(), conn) == refreshList.end()) {
856 webCache.refreshTable(physcon,
"DUMMYTABLE");
859 webCache.refreshSchemaInfo(physcon);
861 ATH_MSG_DEBUG(
"Cache flag for connection " << physcon <<
" set to " << webCache.webCacheInfo(physcon).isSchemaInfoCached());
863 return(StatusCode::SUCCESS);
871 if (catalog.compare(0, 8,
"apcfile:") == 0 || catalog.compare(0, 7,
"prfile:") == 0) {
872 std::string::size_type cpos = catalog.find(
':');
887 <<
" in $ATLAS_POOLCOND_PATH and $DATAPATH");
897 }
catch(std::exception& e) {
898 ATH_MSG_ERROR(
"setWriteCatalog - caught exception: " << e.what());
908std::unique_ptr<pool::IDatabase>
PoolSvc::getDbHandle(
unsigned int contextId,
const std::string& dbName)
const {
910 ATH_MSG_WARNING(
"getDbHandle: Using default input Stream instead of id = " << contextId);
915 Io::IoFlag transMode = Io::READ;
922 if (dbName.compare(0, 4,
"PFN:") == 0) {
924 }
else if (dbName.compare(0, 4,
"LFN:") == 0) {
926 }
else if (dbName.compare(0, 4,
"FID:") == 0) {
934 if (dbH ==
nullptr) {
938 if (contName.find(
"DataHeader") != std::string::npos) {
943 return(std::unique_ptr<pool::IContainer>(contH));
949 const char* cpath = std::getenv(
"ATLAS_POOLCOND_PATH");
950 if (cpath && strcmp(cpath,
"") != 0) {
951 const std::string testpath = std::string(cpath) +
"/" + leaf;
955 if (FILE* fp = std::fopen(testpath.c_str(),
"r")) {
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
This file contains the class definition for the Placement class (migrated from POOL).
bool isNumber(const std::string &s)
This file contains the class definition for the PoolSvc class.
size_t size() const
Number of registered mappings.
This file contains the class definition for the Token class (migrated from POOL).
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
constexpr void toString(std::span< char, StrLen > buf, bool uppercase=true) const noexcept
Automatic conversion to string representation.
static constexpr int stringSize()
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
This class holds all the necessary information to guide the writing of an object in a physical place.
const std::string & auxString() const
Access auxiliary string.
const std::string & containerName() const
Access container name.
virtual StatusCode io_reinit() override
pool::IFileCatalog * createCatalog()
virtual Token * registerForWrite(const Placement *placement, const void *obj, const RootType &classDesc) override
virtual ~PoolSvc()
Destructor.
virtual void startCatalog() override
Gaudi::Property< int > m_retrialTimeOut
ConnectionRetrialTimeOut, the retrial time out for CORAL Connection Service: default = 300 seconds.
Gaudi::Property< int > m_timeOut
ConnectionTimeOut, the time out for CORAL Connection Service: default = 5 seconds.
virtual void renamePfn(const std::string &pf, const std::string &newpf) override
Gaudi::Property< int > m_retrialPeriod
ConnectionRetrialPeriod, retry period for CORAL Connection Service: default = 30 seconds.
virtual const coral::Context * context() const override
pool::IFileCatalog * m_catalog
Gaudi::Property< std::vector< std::string > > m_frontierRefresh
virtual StatusCode connect(Io::IoFlag type, unsigned int contextId=IPoolSvc::kInputStream) override
Connect to a logical database unit; PersistencySvc is chosen according to transaction type (accessmod...
std::string poolCondPath(const std::string &leaf)
Resolve a file using ATLAS_POOLCOND_PATH.
virtual unsigned int getInputContextMapSize() const override
void patchCatalog(const std::string &pfn, pool::IDatabase &dbH) const
virtual unsigned int getInputContext(const std::string &label, unsigned int maxFile=0) override
std::recursive_mutex CallMutex
virtual void lookupBestPfn(const std::string &token, std::string &pfn, std::string &type) const override
virtual StatusCode setAttribute(const std::string &optName, const std::string &data, long tech, unsigned int contextId=IPoolSvc::kOutputStream) const override
Set POOL attributes - domain.
std::vector< pool::ISession * > m_dbSessionVec
Gaudi::Property< bool > m_connClean
ConnectionCleanUp - whether to use CORAL connection management thread: default = false.
Gaudi::Property< bool > m_useROOTIMT
Use ROOT Implicit MultiThreading, default = true.
virtual StatusCode commit(unsigned int contextId=IPoolSvc::kInputStream) const override
Commit data for a given contextId and flush buffer.
std::unique_ptr< pool::IContainer > getContainerHandle(pool::IDatabase *dbH, const std::string &contName) const
Get Container handle.
virtual Token * getToken(const std::string &connection, const std::string &collection, const unsigned long ientry) const override
virtual StatusCode start() override
Required of all Gaudi services:
Gaudi::Property< int > m_frontierComp
Frontier proprties, compression level and list of schemas to be refreshed: default = 5.
StatusCode setupPersistencySvc()
virtual StatusCode io_finalize() override
Gaudi::Property< int > m_dbAgeLimit
MaxFilesOpen, option to have PoolSvc limit the number of open Input Files: default = 0 (No files are ...
Gaudi::Property< bool > m_useROOTMaxTree
Increase virtual TTree size to avoid backreads in multithreading, default = false.
std::map< std::string, unsigned int > m_outputContextLabel
virtual StatusCode disconnectDb(const std::string &connection, unsigned int contextId=IPoolSvc::kInputStream) const override
Disconnect single Database.
virtual void commitCatalog() override
std::vector< CallMutex * > m_pers_mut
std::map< std::string, unsigned int > m_inputContextLabel
virtual void setObjPtr(void *&obj, const Token *token) override
virtual void loadComponent(const std::string &compName) override
Gaudi::Property< std::vector< std::string > > m_readCatalog
ReadCatalog, the list of additional POOL input file catalogs to consult: default = empty vector.
std::string m_mainOutputLabel
virtual pool::ICollection * createCollection(const std::string &connection, const std::string &collectionName, const pool::DbType &collectionType=pool::POOL_StorageType.type(), unsigned int contextId=IPoolSvc::kInputStream) const override
std::map< unsigned int, unsigned int > m_contextMaxFile
virtual void setShareMode(bool shareCat) override
std::unique_ptr< pool::IDatabase > getDbHandle(unsigned int contextId, const std::string &dbName) const
Get Database handle.
coral::Context * m_context
virtual StatusCode commitAndHold(unsigned int contextId=IPoolSvc::kInputStream) const override
Commit data for a given contextId and hold buffer.
virtual StatusCode disconnect(unsigned int contextId=IPoolSvc::kInputStream) const override
Disconnect PersistencySvc associated with a contextId.
virtual StatusCode finalize() override
Required of all Gaudi services:
virtual StatusCode initialize() override
Required of all Gaudi services:
virtual StatusCode setFrontierCache(const std::string &conn) override
Setup Frontier cache for given logical or physical connection name.
virtual std::map< std::string, unsigned int > getInputContextMap() const override
virtual unsigned int getOutputContext(const std::string &label) override
Gaudi::Property< std::string > m_writeCatalog
WriteCatalog, the file catalog to be used to register output files (also default input catalog): defa...
virtual StatusCode stop() override
Gaudi::Property< bool > m_attemptCatalogPatch
AttemptCatalogPatch, option to create catalog: default = false.
std::map< unsigned int, std::list< Guid > > m_guidLists ATLAS_THREAD_SAFE
virtual StatusCode getAttribute(const std::string &optName, std::string &data, long tech, unsigned int contextId=IPoolSvc::kInputStream) const override
Get POOL attributes - domain.
This class provides a token that identifies in a unique way objects on the persistent storage.
const std::string & auxString() const
Access auxiliary string.
const std::string toString() const
Retrieve the string representation of the token.
Token & fromString(const std::string_view from)
Build from the string representation of a token.
const Guid & dbID() const
Access database identifier.
A service for creating, accessing and managing an ensemble of collections of event references.
const std::string storageName() const
Human readable storage type.
int majorType() const
Access to major type.
An interface to a storage technology specific collection of event references and attributes.
IContainer is the base class for container objects.
IDatabase is the base class for database objects.
virtual bool setTechnology(long technology)=0
Sets the technology identifier for this database.
virtual const std::string & fid()=0
Returns the file identifier of this database.
virtual IContainer * containerHandle(const std::string &name)=0
Returns a pointer to a container object. The user acquires ownership of that object.
void addReadCatalog(const std::string &connect)
Add new catalog, identified by name, to the existing ones.
void removeCatalog(const std::string &connect)
Remove catalog identified by name from the existing ones. * or '' removes all.
void setWriteCatalog(const std::string &connect)
Establish the writable catalog, identified by name.
ISession is the interface class for user (macroscopic) sessions Every transaction and connection to a...
virtual std::unique_ptr< IDatabase > databaseHandle(const std::string &dbName, DatabaseSpecification::NameType dbNameType)=0
Returns a pointer to a database object. The user acquires ownership of that object.
virtual ITransaction & transaction()=0
Returns the transaction interface.
virtual const ITechnologySpecificAttributes & technologySpecificAttributes(long technology) const =0
Returns the object holding the technology specific attributes for a given technology domain.
virtual bool disconnectAll()=0
Explicitly disconnects all the databases.
T attribute(const std::string &attributeName, const std::string &option="")
Templated method to retrieve an attribute.
bool setAttribute(const std::string &attributeName, const T &atttibuteValue, const std::string &option="")
Templated method to set an attribute.
virtual bool commitAndHold()=0
Commits the holds transaction.
virtual bool start(Io::IoFlag type=Io::READ)=0
Starts a new transaction. Returns the success of the operation.
virtual bool isActive() const =0
Checks if the transaction is active.
static std::string release
std::string label(const std::string &format, int i)
std::unique_ptr< ISession > createSession(IFileCatalog &catalog, int ageLimit=-1)
static const DbType ROOT_StorageType
static const DbType POOL_StorageType
static void setLevel(MSG::Level l)