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"
52 return !s.empty() && (std::isdigit(s[0]) || s[0] ==
'+' || s[0] ==
'-');
66 if (
catalog.starts_with(
"xmlcatalog_file:")) {
67 const std::string fileName =
catalog.substr(16);
68 if (!iomgr->io_register(
this, IIoComponentMgr::IoMode::READ, fileName, fileName).isSuccess()) {
78 if (!iomgr->io_register(
this, IIoComponentMgr::IoMode::WRITE, fileName, fileName).isSuccess()) {
86 return(StatusCode::FAILURE);
91 return(StatusCode::FAILURE);
93 coral::ConnectionService conSvcH;
94 coral::IConnectionServiceConfiguration& csConfig = conSvcH.configuration();
98 csConfig.enablePoolAutomaticCleanUp();
101 csConfig.disablePoolAutomaticCleanUp();
102 csConfig.setConnectionTimeOut(0);
104 ATH_MSG_INFO(
"Set connectionsvc retry/timeout/IDLE timeout to "
110 <<
" seconds with connection cleanup "
111 << (csConfig.isPoolAutomaticCleanUpEnabled() ?
"enabled" :
"disabled"));
113 coral::IWebCacheControl& webCache = conSvcH.webCacheControl();
115 ATH_MSG_INFO(
"Frontier compression level set to " << webCache.compressionLevel());
119 if (replicasvc.retrieve().isSuccess()) {
120 csConfig.setReplicaSortingAlgorithm(*replicasvc);
121 ATH_MSG_INFO(
"Successfully setup replica sorting algorithm");
126 MSG::Level athLvl =
msg().level();
136 if (!iomgr.retrieve().isSuccess()) {
138 return(StatusCode::FAILURE);
140 if (!iomgr->io_hasitem(
this)) {
141 ATH_MSG_FATAL(
"IoComponentMgr does not know about myself !");
142 return(StatusCode::FAILURE);
145 for (std::size_t icat = 0,
imax = readcat.size(); icat <
imax; icat++) {
146 if (readcat[icat].compare(0, 16,
"xmlcatalog_file:") == 0) {
147 std::string fileName = readcat[icat].substr(16);
148 if (iomgr->io_contains(
this, fileName)) {
149 if (!iomgr->io_retrieve(
this, fileName).isSuccess()) {
150 ATH_MSG_FATAL(
"Could not retrieve new value for [" << fileName <<
"] !");
151 return(StatusCode::FAILURE);
153 readcat[icat] =
"xmlcatalog_file:" + fileName;
159 if (
m_writeCatalog.value().compare(0, 16,
"xmlcatalog_file:") == 0) {
161 if (iomgr->io_contains(
this, fileName)) {
162 if (!iomgr->io_retrieve(
this, fileName).isSuccess()) {
163 ATH_MSG_FATAL(
"Could not retrieve new value for [" << fileName <<
"] !");
164 return(StatusCode::FAILURE);
182 return(StatusCode::FAILURE);
188 ATH_MSG_FATAL(
"Failed to enable thread safety in ROOT via PersistencySvc.");
189 return(StatusCode::FAILURE);
194 return(StatusCode::FAILURE);
199 ATH_MSG_FATAL(
"Failed to set ROOT default container type via PersistencySvc.");
200 return(StatusCode::FAILURE);
203 return(StatusCode::SUCCESS);
208 if (
m_useROOTIMT && Gaudi::Concurrency::ConcurrencyFlags::numThreads() > 1) {
210 ATH_MSG_FATAL(
"Failed to enable implicit multithreading in ROOT via PersistencySvc.");
211 return(StatusCode::FAILURE);
213 ATH_MSG_INFO(
"Enabled implicit multithreading in ROOT via PersistencySvc to: " << Gaudi::Concurrency::ConcurrencyFlags::numThreads() - 1);
215 return(StatusCode::SUCCESS);
220 bool retError =
false;
227 return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS);
238 for (
const auto& persistencyMutex :
m_pers_mut) {
239 delete persistencyMutex;
253 return(::AthService::finalize());
265 return(StatusCode::SUCCESS);
272 const std::string& auxString = placement->
auxString();
273 if (!auxString.empty()) {
274 if (auxString.compare(0, 6,
"[CTXT=") == 0) {
275 ::sscanf(auxString.c_str(),
"[CTXT=%08X]", &contextId);
276 }
else if (auxString.compare(0, 8,
"[CLABEL=") == 0) {
280 ATH_MSG_WARNING(
"registerForWrite: Using default output Stream instead of id = " << contextId);
286 if (token ==
nullptr) {
294 const std::string& auxString = token->
auxString();
295 if (!auxString.empty()) {
296 if (auxString.compare(0, 6,
"[CTXT=") == 0) {
297 ::sscanf(auxString.c_str(),
"[CTXT=%08X]", &contextId);
298 }
else if (auxString.compare(0, 8,
"[CLABEL=") == 0) {
302 ATH_MSG_WARNING(
"setObjPtr: Using default input Stream instead of id = " << contextId);
306 ATH_MSG_VERBOSE(
"setObjPtr: token=" << token->
toString() <<
", auxString=" << auxString <<
", contextID=" << contextId);
310 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
312 m_guidLists[contextId].remove(token->
dbID());
313 m_guidLists[contextId].push_back(token->
dbID());
314 while (m_guidLists[contextId].
size() > maxFileIter->second) {
315 this->
disconnectDb(
"FID:" + m_guidLists[contextId].begin()->toString(), contextId).ignore();
331 return(contextIter->second);
337 ATH_MSG_WARNING(
"Failed to set ROOT default container type via PersistencySvc for id " <<
id);
346 if (!
label.empty()) {
352 return(contextIter->second);
358 if (!
connect(Io::READ,
id).isSuccess()) {
362 if (!
label.empty()) {
397 if (token.compare(0, 4,
"PFN:") == 0) {
399 }
else if (token.compare(0, 4,
"LFN:") == 0) {
400 m_catalog->lookupFileByLFN(token.substr(4), dbID);
401 }
else if (token.compare(0, 4,
"FID:") == 0) {
402 dbID = token.substr(4);
414 std::string dbID,
type;
429 const std::string& collectionName,
431 unsigned int contextId)
const {
433 <<
", name=" << collectionName <<
", contextID=" << contextId);
435 ATH_MSG_WARNING(
"createCollection: Using default input Stream instead of id = " << contextId);
440 bool insertFile =
false;
441 if (connection.compare(0, 4,
"PFN:") == 0) {
442 std::string fid, fileType;
443 m_catalog->lookupFileByPFN(connection.substr(4), fid, fileType);
446 ATH_MSG_INFO(
"File is not in Catalog! Attempt to open it anyway.");
451 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
452 if (dbH ==
nullptr) {
453 ATH_MSG_INFO(
"Failed to get Session/DatabaseHandle to create POOL collection.");
457 if (dbH->openMode() == Io::INVALID) {
458 dbH->connectForRead();
460 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
461 if (maxFileIter !=
m_contextMaxFile.end() && maxFileIter->second > 0 && !dbH->fid().empty()) {
462 const Guid guid(dbH->fid());
463 m_guidLists[contextId].remove(guid);
464 m_guidLists[contextId].push_back(guid);
465 while (m_guidLists[contextId].
size() > maxFileIter->second + 1) {
466 this->
disconnectDb(
"FID:" + m_guidLists[contextId].begin()->toString(), contextId).ignore();
469 }
catch (std::exception& e) {
470 ATH_MSG_INFO(
"Failed to open container to check POOL collection - trying.");
480 std::string error_text;
482 collPtr = collSvc.open(collectionName, collectionType, connection,
m_dbSessionVec[contextId]);
483 }
catch (std::exception &e) {
485 error_text = e.what();
488 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
489 if (dbH !=
nullptr && !dbH->fid().empty()) {
492 throw std::runtime_error(
"Failed to open Collection: " + error_text +
", PoolSvc::createCollection");
495 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
496 if (dbH ==
nullptr) {
498 }
else if (dbH->fid().empty()) {
499 ATH_MSG_INFO(
"Cannot retrieve the FID of an existing POOL database: '"
500 << connection <<
"' - FileCatalog will NOT be updated.");
507 if (
m_useROOTMaxTree && Gaudi::Concurrency::ConcurrencyFlags::numConcurrentEvents() > 1) {
519 std::string fid = dbH.
fid();
521 catalog_locked->registerPFN(pfn,
"ROOT_All", fid);
525 const std::string& collection,
526 const unsigned long ientry)
const {
529 if (dbH ==
nullptr) {
532 if (dbH->openMode() == Io::INVALID) {
533 dbH->connectForRead();
536 if (contH ==
nullptr) {
539 auto tokenIter = std::unique_ptr<pool::ITokenIterator>(contH->tokens());
541 return tokenIter->seek(ientry)? tokenIter->next() :
nullptr;
545 if (
type != Io::READ) {
547 ATH_MSG_WARNING(
"connect: Using default output Stream instead of id = " << contextId);
552 ATH_MSG_WARNING(
"connect: Using default input Stream instead of id = " << contextId);
555 ATH_MSG_INFO(
"Connecting to InputStream for: " << contextId);
560 return(StatusCode::FAILURE);
565 if (session->transaction().isActive()) {
566 return(StatusCode::SUCCESS);
568 if (!session->start(
type)) {
570 return(StatusCode::FAILURE);
573 return(StatusCode::SUCCESS);
578 return(StatusCode::FAILURE);
582 if (session !=
nullptr && session->transaction().isActive()) {
583 if (!session->commit()) {
585 return(StatusCode::FAILURE);
587 if (session->transaction().type() == Io::READ) {
588 session->disconnectAll();
591 return(StatusCode::SUCCESS);
596 return(StatusCode::FAILURE);
603 return(StatusCode::FAILURE);
606 return(StatusCode::SUCCESS);
610 ATH_MSG_DEBUG(
"Disconnect request for contextId=" << contextId);
612 return(StatusCode::SUCCESS);
617 if (!
commit(contextId).isSuccess()) {
619 return(StatusCode::FAILURE);
624 ATH_MSG_ERROR(
"disconnect failed to diconnect PersistencySvc");
625 return(StatusCode::FAILURE);
628 return(StatusCode::SUCCESS);
633 return(StatusCode::SUCCESS);
636 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
637 if (dbH ==
nullptr) {
639 return(StatusCode::FAILURE);
641 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
643 m_guidLists[contextId].remove(
Guid(dbH->fid()));
646 return(StatusCode::SUCCESS);
652 unsigned int contextId)
const {
654 ATH_MSG_WARNING(
"getAttribute: Using default input Stream instead of id = " << contextId);
659 std::ostringstream oss;
660 if (
data ==
"DbLonglong") {
662 }
else if (
data ==
"double") {
669 return(StatusCode::SUCCESS);
675 const std::string& dbName,
676 const std::string& contName,
677 unsigned int contextId)
const {
679 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
680 if (dbH ==
nullptr) {
681 ATH_MSG_DEBUG(
"getAttribute: Failed to get Session/DatabaseHandle to get POOL property.");
682 return(StatusCode::FAILURE);
684 if (dbH->openMode() == Io::INVALID) {
686 dbH->setTechnology(tech);
687 dbH->connectForWrite();
689 dbH->connectForRead();
692 std::ostringstream oss;
693 if (contName.empty()) {
694 if (
data ==
"DbLonglong") {
695 oss << std::dec << dbH->technologySpecificAttributes().attribute<
long long int>(optName);
696 }
else if (
data ==
"double") {
697 oss << std::dec << dbH->technologySpecificAttributes().attribute<
double>(optName);
698 }
else if (
data ==
"string") {
699 oss << dbH->technologySpecificAttributes().attribute<
char*>(optName);
701 oss << std::dec << dbH->technologySpecificAttributes().attribute<
int>(optName);
703 ATH_MSG_INFO(
"Database (" << dbH->pfn() <<
") attribute [" << optName <<
"]" <<
": " << oss.str());
706 if (contH ==
nullptr) {
707 ATH_MSG_DEBUG(
"Failed to get ContainerHandle to get POOL property.");
708 return(StatusCode::FAILURE);
710 if (
data ==
"DbLonglong") {
711 oss << std::dec << contH->technologySpecificAttributes().attribute<
long long int>(optName);
712 }
else if (
data ==
"double") {
713 oss << std::dec << contH->technologySpecificAttributes().attribute<
double>(optName);
715 oss << std::dec << contH->technologySpecificAttributes().attribute<
int>(optName);
717 ATH_MSG_INFO(
"Container attribute [" << contName <<
"." << optName <<
"]: " << oss.str());
720 return(StatusCode::SUCCESS);
724 const std::string&
data,
726 unsigned int contextId)
const {
728 ATH_MSG_WARNING(
"setAttribute: Using default output Stream instead of id = " << contextId);
736 return(StatusCode::FAILURE);
741 return(StatusCode::FAILURE);
744 return(StatusCode::SUCCESS);
748 const std::string&
data,
750 const std::string& dbName,
751 const std::string& contName,
752 unsigned int contextId)
const {
754 ATH_MSG_WARNING(
"setAttribute: Using default output Stream instead of id = " << contextId);
758 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
759 if (dbH ==
nullptr) {
760 ATH_MSG_DEBUG(
"Failed to get Session/DatabaseHandle to set POOL property.");
761 return(StatusCode::FAILURE);
763 if (dbH->openMode() == Io::INVALID) {
765 dbH->setTechnology(tech);
766 dbH->connectForWrite();
768 dbH->connectForRead();
771 bool retError =
false;
773 bool hasTTreeName = (contName.length() > 6 && contName.compare(0, 6,
"TTree=") == 0);
774 if (contName.empty() || hasTTreeName ||
m_dbSessionVec[contextId]->transaction().type() == Io::READ) {
775 objName = hasTTreeName ? contName.substr(6) : contName;
777 retError = dbH->technologySpecificAttributes().setAttribute(optName,
data.c_str(), objName);
778 }
else if(
data[
data.size() - 1] ==
'L' ) {
779 retError = dbH->technologySpecificAttributes().setAttribute<
long long int>(optName, atoll(
data.c_str()), objName);
781 retError = dbH->technologySpecificAttributes().setAttribute<
int>(optName, atoi(
data.c_str()), objName);
785 return(StatusCode::FAILURE);
789 if (contH ==
nullptr) {
790 ATH_MSG_DEBUG(
"Failed to get ContainerHandle to set POOL property.");
791 return(StatusCode::FAILURE);
793 if (
auto p = contName.find(
'('); p != std::string::npos) {
794 objName = contName.substr(p + 1);
795 objName.erase(objName.find(
')'));
796 }
else if (
auto p = contName.find(
"::"); p != std::string::npos) {
797 objName = contName.substr(p + 2);
798 }
else if (
auto p = contName.find(
'_'); p != std::string::npos) {
799 objName = contName.substr(p + 1);
800 objName.erase(objName.find(
'/'));
802 std::string::size_type off = 0;
803 while ((off = objName.find_first_of(
"<>/")) != std::string::npos) {
807 retError = contH->technologySpecificAttributes().setAttribute<
long long int>(optName, atoll(
data.c_str()), objName);
809 retError = contH->technologySpecificAttributes().setAttribute<
int>(optName, atoi(
data.c_str()), objName);
812 ATH_MSG_DEBUG(
"Failed to set POOL container property, " << optName <<
" for " << contName <<
" : " << objName <<
" to " <<
data);
813 return(StatusCode::FAILURE);
816 return(StatusCode::SUCCESS);
824 std::vector<std::string> physcons;
825 if (conn.find(
':') == std::string::npos) {
828 const std::string lookSvcStr(
"CORAL/Services/XMLLookupService");
829 coral::IHandle<coral::ILookupService> lookSvcH =
m_context->query<coral::ILookupService>();
830 if (!lookSvcH.isValid()) {
832 lookSvcH =
m_context->query<coral::ILookupService>();
834 if (!lookSvcH.isValid()) {
836 return(StatusCode::FAILURE);
838 coral::IDatabaseServiceSet* dbset = lookSvcH->lookup(conn, coral::ReadOnly);
839 if (dbset !=
nullptr) {
840 for (
int irep = 0, nrep = dbset->numberOfReplicas(); irep < nrep; ++irep) {
841 const std::string pcon = dbset->replica(irep).connectionString();
842 if (pcon.compare(0, 9,
"frontier:") == 0) {
843 physcons.push_back(std::move(pcon));
846 delete dbset; dbset =
nullptr;
848 ATH_MSG_DEBUG(
"setFrontierCache: Could not find any replicas for " << conn);
850 }
else if (conn.compare(0, 9,
"frontier:") == 0) {
851 physcons.push_back(conn);
854 if (physcons.size() == 0) {
855 return(StatusCode::SUCCESS);
857 coral::ConnectionService conSvcH;
861 coral::IWebCacheControl& webCache = conSvcH.webCacheControl();
862 for (
const auto& physcon : physcons) {
864 if (std::find(refreshList.begin(), refreshList.end(), physcon) == refreshList.end()
865 && std::find(refreshList.begin(), refreshList.end(), conn) == refreshList.end()) {
868 webCache.refreshTable(physcon,
"DUMMYTABLE");
871 webCache.refreshSchemaInfo(physcon);
873 ATH_MSG_DEBUG(
"Cache flag for connection " << physcon <<
" set to " << webCache.webCacheInfo(physcon).isSchemaInfoCached());
875 return(StatusCode::SUCCESS);
883 if (
catalog.compare(0, 8,
"apcfile:") == 0 ||
catalog.compare(0, 7,
"prfile:") == 0) {
884 std::string::size_type cpos =
catalog.find(
':');
899 <<
" in $ATLAS_POOLCOND_PATH and $DATAPATH");
909 }
catch(std::exception& e) {
910 ATH_MSG_ERROR(
"setWriteCatalog - caught exception: " << e.what());
920std::unique_ptr<pool::IDatabase>
PoolSvc::getDbHandle(
unsigned int contextId,
const std::string& dbName)
const {
922 ATH_MSG_WARNING(
"getDbHandle: Using default input Stream instead of id = " << contextId);
927 Io::IoFlag transMode = Io::READ;
934 if (dbName.compare(0, 4,
"PFN:") == 0) {
936 }
else if (dbName.compare(0, 4,
"LFN:") == 0) {
938 }
else if (dbName.compare(0, 4,
"FID:") == 0) {
946 if (dbH ==
nullptr) {
950 if (contName.find(
"DataHeader") != std::string::npos) {
955 return(std::unique_ptr<pool::IContainer>(contH));
961 const char* cpath = std::getenv(
"ATLAS_POOLCOND_PATH");
962 if (cpath && strcmp(cpath,
"") != 0) {
963 const std::string testpath = std::string(cpath) +
"/" + leaf;
967 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)
char data[hepevt_bytes_allocation_ATLAS]
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.
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
Gaudi::Property< bool > m_sortReplicas
Use DBReplicaSvc to sort database connections, default = true.
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< std::string > m_defaultContainerType
Default ROOT container type.
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.
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
virtual const pool::IFileCatalog * catalog() 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.
virtual 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.
static DbType getType(const std::string &name)
Access known storage type object by name.
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)