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);
206 ATH_MSG_FATAL(
"Failed to set ROOT default container type via PersistencySvc.");
207 return(StatusCode::FAILURE);
210 return(StatusCode::SUCCESS);
215 if (
m_useROOTIMT && Gaudi::Concurrency::ConcurrencyFlags::numThreads() > 1) {
217 ATH_MSG_FATAL(
"Failed to enable implicit multithreading in ROOT via PersistencySvc.");
218 return(StatusCode::FAILURE);
220 ATH_MSG_INFO(
"Enabled implicit multithreading in ROOT via PersistencySvc to: " << Gaudi::Concurrency::ConcurrencyFlags::numThreads() - 1);
222 return(StatusCode::SUCCESS);
227 bool retError =
false;
234 return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS);
245 for (
const auto& persistencyMutex :
m_pers_mut) {
246 delete persistencyMutex;
260 return(::AthService::finalize());
272 return(StatusCode::SUCCESS);
279 const std::string& auxString = placement->
auxString();
280 if (!auxString.empty()) {
281 if (auxString.compare(0, 6,
"[CTXT=") == 0) {
282 ::sscanf(auxString.c_str(),
"[CTXT=%08X]", &contextId);
283 }
else if (auxString.compare(0, 8,
"[CLABEL=") == 0) {
287 ATH_MSG_WARNING(
"registerForWrite: Using default output Stream instead of id = " << contextId);
293 if (token ==
nullptr) {
301 const std::string& auxString = token->
auxString();
302 if (!auxString.empty()) {
303 if (auxString.compare(0, 6,
"[CTXT=") == 0) {
304 ::sscanf(auxString.c_str(),
"[CTXT=%08X]", &contextId);
305 }
else if (auxString.compare(0, 8,
"[CLABEL=") == 0) {
309 ATH_MSG_WARNING(
"setObjPtr: Using default input Stream instead of id = " << contextId);
313 ATH_MSG_VERBOSE(
"setObjPtr: token=" << token->
toString() <<
", auxString=" << auxString <<
", contextID=" << contextId);
317 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
319 m_guidLists[contextId].remove(token->
dbID());
320 m_guidLists[contextId].push_back(token->
dbID());
321 while (m_guidLists[contextId].
size() > maxFileIter->second) {
322 this->
disconnectDb(
"FID:" + m_guidLists[contextId].begin()->toString(), contextId).ignore();
338 return(contextIter->second);
351 ATH_MSG_WARNING(
"Failed to set ROOT default container type via PersistencySvc for id " <<
id);
360 if (!
label.empty()) {
366 return(contextIter->second);
376 if (!
label.empty()) {
411 if (token.compare(0, 4,
"PFN:") == 0) {
413 }
else if (token.compare(0, 4,
"LFN:") == 0) {
414 m_catalog->lookupFileByLFN(token.substr(4), dbID);
415 }
else if (token.compare(0, 4,
"FID:") == 0) {
416 dbID = token.substr(4);
428 std::string dbID,
type;
443 const std::string& collectionName,
445 unsigned int contextId)
const {
447 <<
", name=" << collectionName <<
", contextID=" << contextId);
449 ATH_MSG_WARNING(
"createCollection: Using default input Stream instead of id = " << contextId);
454 bool insertFile =
false;
455 if (connection.compare(0, 4,
"PFN:") == 0) {
456 std::string fid, fileType;
457 m_catalog->lookupFileByPFN(connection.substr(4), fid, fileType);
460 ATH_MSG_INFO(
"File is not in Catalog! Attempt to open it anyway.");
465 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
466 if (dbH ==
nullptr) {
467 ATH_MSG_INFO(
"Failed to get Session/DatabaseHandle to create POOL collection.");
472 dbH->connectForRead();
474 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
475 if (maxFileIter !=
m_contextMaxFile.end() && maxFileIter->second > 0 && !dbH->fid().empty()) {
476 const Guid guid(dbH->fid());
477 m_guidLists[contextId].remove(guid);
478 m_guidLists[contextId].push_back(guid);
479 while (m_guidLists[contextId].
size() > maxFileIter->second + 1) {
480 this->
disconnectDb(
"FID:" + m_guidLists[contextId].begin()->toString(), contextId).ignore();
483 }
catch (std::exception& e) {
484 ATH_MSG_INFO(
"Failed to open container to check POOL collection - trying.");
494 std::string error_text;
496 collPtr = collSvc.open(collectionName, collectionType, connection,
m_dbSessionVec[contextId]);
497 }
catch (std::exception &e) {
499 error_text = e.what();
502 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
503 if (dbH !=
nullptr && !dbH->fid().empty()) {
506 throw std::runtime_error(
"Failed to open Collection: " + error_text +
", PoolSvc::createCollection");
509 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
510 if (dbH ==
nullptr) {
512 }
else if (dbH->fid().empty()) {
513 ATH_MSG_INFO(
"Cannot retrieve the FID of an existing POOL database: '"
514 << connection <<
"' - FileCatalog will NOT be updated.");
521 if (
m_useROOTMaxTree && Gaudi::Concurrency::ConcurrencyFlags::numConcurrentEvents() > 1) {
533 std::string fid = dbH.
fid();
535 catalog_locked->registerPFN(pfn,
"ROOT_All", fid);
539 const std::string& collection,
540 const unsigned long ientry)
const {
543 if (dbH ==
nullptr) {
547 dbH->connectForRead();
550 if (contH ==
nullptr) {
553 auto tokenIter = std::unique_ptr<pool::ITokenIterator>(contH->tokens());
555 return tokenIter->seek(ientry)? tokenIter->next() :
nullptr;
561 ATH_MSG_WARNING(
"connect: Using default output Stream instead of id = " << contextId);
566 ATH_MSG_WARNING(
"connect: Using default input Stream instead of id = " << contextId);
569 ATH_MSG_INFO(
"Connecting to InputStream for: " << contextId);
574 return(StatusCode::FAILURE);
579 if (session->transaction().isActive()) {
580 return(StatusCode::SUCCESS);
582 if (!session->start(
type)) {
584 return(StatusCode::FAILURE);
587 return(StatusCode::SUCCESS);
592 return(StatusCode::FAILURE);
596 if (session !=
nullptr && session->transaction().isActive()) {
597 if (!session->commit()) {
599 return(StatusCode::FAILURE);
602 session->disconnectAll();
605 return(StatusCode::SUCCESS);
610 return(StatusCode::FAILURE);
617 return(StatusCode::FAILURE);
620 return(StatusCode::SUCCESS);
624 ATH_MSG_DEBUG(
"Disconnect request for contextId=" << contextId);
626 return(StatusCode::SUCCESS);
631 if (!
commit(contextId).isSuccess()) {
633 return(StatusCode::FAILURE);
638 ATH_MSG_ERROR(
"disconnect failed to diconnect PersistencySvc");
639 return(StatusCode::FAILURE);
642 return(StatusCode::SUCCESS);
647 return(StatusCode::SUCCESS);
650 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
651 if (dbH ==
nullptr) {
653 return(StatusCode::FAILURE);
655 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
657 m_guidLists[contextId].remove(
Guid(dbH->fid()));
660 return(StatusCode::SUCCESS);
666 unsigned int contextId)
const {
668 ATH_MSG_WARNING(
"getAttribute: Using default input Stream instead of id = " << contextId);
673 std::ostringstream oss;
674 if (
data ==
"DbLonglong") {
676 }
else if (
data ==
"double") {
683 return(StatusCode::SUCCESS);
689 const std::string& dbName,
690 const std::string& contName,
691 unsigned int contextId)
const {
693 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
694 if (dbH ==
nullptr) {
695 ATH_MSG_DEBUG(
"getAttribute: Failed to get Session/DatabaseHandle to get POOL property.");
696 return(StatusCode::FAILURE);
700 dbH->setTechnology(tech);
701 dbH->connectForWrite();
703 dbH->connectForRead();
706 std::ostringstream oss;
707 if (contName.empty()) {
708 if (
data ==
"DbLonglong") {
709 oss << std::dec << dbH->technologySpecificAttributes().attribute<
long long int>(optName);
710 }
else if (
data ==
"double") {
711 oss << std::dec << dbH->technologySpecificAttributes().attribute<
double>(optName);
712 }
else if (
data ==
"string") {
713 oss << dbH->technologySpecificAttributes().attribute<
char*>(optName);
715 oss << std::dec << dbH->technologySpecificAttributes().attribute<
int>(optName);
717 ATH_MSG_INFO(
"Database (" << dbH->pfn() <<
") attribute [" << optName <<
"]" <<
": " << oss.str());
720 if (contH ==
nullptr) {
721 ATH_MSG_DEBUG(
"Failed to get ContainerHandle to get POOL property.");
722 return(StatusCode::FAILURE);
724 if (
data ==
"DbLonglong") {
725 oss << std::dec << contH->technologySpecificAttributes().attribute<
long long int>(optName);
726 }
else if (
data ==
"double") {
727 oss << std::dec << contH->technologySpecificAttributes().attribute<
double>(optName);
729 oss << std::dec << contH->technologySpecificAttributes().attribute<
int>(optName);
731 ATH_MSG_INFO(
"Container attribute [" << contName <<
"." << optName <<
"]: " << oss.str());
734 return(StatusCode::SUCCESS);
738 const std::string&
data,
740 unsigned int contextId)
const {
742 ATH_MSG_WARNING(
"setAttribute: Using default output Stream instead of id = " << contextId);
750 return(StatusCode::FAILURE);
755 return(StatusCode::FAILURE);
758 return(StatusCode::SUCCESS);
762 const std::string&
data,
764 const std::string& dbName,
765 const std::string& contName,
766 unsigned int contextId)
const {
768 ATH_MSG_WARNING(
"setAttribute: Using default output Stream instead of id = " << contextId);
772 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
773 if (dbH ==
nullptr) {
774 ATH_MSG_DEBUG(
"Failed to get Session/DatabaseHandle to set POOL property.");
775 return(StatusCode::FAILURE);
779 dbH->setTechnology(tech);
780 dbH->connectForWrite();
782 dbH->connectForRead();
785 bool retError =
false;
787 bool hasTTreeName = (contName.length() > 6 && contName.compare(0, 6,
"TTree=") == 0);
789 objName = hasTTreeName ? contName.substr(6) : contName;
791 retError = dbH->technologySpecificAttributes().setAttribute(optName,
data.c_str(), objName);
792 }
else if(
data[
data.size() - 1] ==
'L' ) {
793 retError = dbH->technologySpecificAttributes().setAttribute<
long long int>(optName, atoll(
data.c_str()), objName);
795 retError = dbH->technologySpecificAttributes().setAttribute<
int>(optName, atoi(
data.c_str()), objName);
799 return(StatusCode::FAILURE);
803 if (contH ==
nullptr) {
804 ATH_MSG_DEBUG(
"Failed to get ContainerHandle to set POOL property.");
805 return(StatusCode::FAILURE);
807 if (
auto p = contName.find(
'('); p != std::string::npos) {
808 objName = contName.substr(p + 1);
809 objName.erase(objName.find(
')'));
810 }
else if (
auto p = contName.find(
"::"); p != std::string::npos) {
811 objName = contName.substr(p + 2);
812 }
else if (
auto p = contName.find(
'_'); p != std::string::npos) {
813 objName = contName.substr(p + 1);
814 objName.erase(objName.find(
'/'));
816 std::string::size_type off = 0;
817 while ((off = objName.find_first_of(
"<>/")) != std::string::npos) {
821 retError = contH->technologySpecificAttributes().setAttribute<
long long int>(optName, atoll(
data.c_str()), objName);
823 retError = contH->technologySpecificAttributes().setAttribute<
int>(optName, atoi(
data.c_str()), objName);
826 ATH_MSG_DEBUG(
"Failed to set POOL container property, " << optName <<
" for " << contName <<
" : " << objName <<
" to " <<
data);
827 return(StatusCode::FAILURE);
830 return(StatusCode::SUCCESS);
838 std::vector<std::string> physcons;
839 if (conn.find(
':') == std::string::npos) {
842 const std::string lookSvcStr(
"CORAL/Services/XMLLookupService");
843 coral::IHandle<coral::ILookupService> lookSvcH =
m_context->query<coral::ILookupService>();
844 if (!lookSvcH.isValid()) {
846 lookSvcH =
m_context->query<coral::ILookupService>();
848 if (!lookSvcH.isValid()) {
850 return(StatusCode::FAILURE);
852 coral::IDatabaseServiceSet* dbset = lookSvcH->lookup(conn, coral::ReadOnly);
853 if (dbset !=
nullptr) {
854 for (
int irep = 0, nrep = dbset->numberOfReplicas(); irep < nrep; ++irep) {
855 const std::string pcon = dbset->replica(irep).connectionString();
856 if (pcon.compare(0, 9,
"frontier:") == 0) {
857 physcons.push_back(std::move(pcon));
860 delete dbset; dbset =
nullptr;
862 ATH_MSG_DEBUG(
"setFrontierCache: Could not find any replicas for " << conn);
864 }
else if (conn.compare(0, 9,
"frontier:") == 0) {
865 physcons.push_back(conn);
868 if (physcons.size() == 0) {
869 return(StatusCode::SUCCESS);
871 coral::ConnectionService conSvcH;
875 coral::IWebCacheControl& webCache = conSvcH.webCacheControl();
876 for (
const auto& physcon : physcons) {
878 if (std::find(refreshList.begin(), refreshList.end(), physcon) == refreshList.end()
879 && std::find(refreshList.begin(), refreshList.end(), conn) == refreshList.end()) {
882 webCache.refreshTable(physcon,
"DUMMYTABLE");
885 webCache.refreshSchemaInfo(physcon);
887 ATH_MSG_DEBUG(
"Cache flag for connection " << physcon <<
" set to " << webCache.webCacheInfo(physcon).isSchemaInfoCached());
889 return(StatusCode::SUCCESS);
897 if (
catalog.compare(0, 8,
"apcfile:") == 0 ||
catalog.compare(0, 7,
"prfile:") == 0) {
898 std::string::size_type cpos =
catalog.find(
':');
913 <<
" in $ATLAS_POOLCOND_PATH and $DATAPATH");
923 }
catch(std::exception& e) {
924 ATH_MSG_ERROR(
"setWriteCatalog - caught exception: " << e.what());
934std::unique_ptr<pool::IDatabase>
PoolSvc::getDbHandle(
unsigned int contextId,
const std::string& dbName)
const {
936 ATH_MSG_WARNING(
"getDbHandle: Using default input Stream instead of id = " << contextId);
951 if (dbName.compare(0, 4,
"PFN:") == 0) {
953 }
else if (dbName.compare(0, 4,
"LFN:") == 0) {
955 }
else if (dbName.compare(0, 4,
"FID:") == 0) {
963 if (dbH ==
nullptr) {
970 if (contName.find(
"DataHeader") != std::string::npos) {
975 return(std::unique_ptr<pool::IContainer>(contH));
981 const char* cpath = std::getenv(
"ATLAS_POOLCOND_PATH");
982 if (cpath && strcmp(cpath,
"") != 0) {
983 const std::string testpath = std::string(cpath) +
"/" + leaf;
987 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.
virtual StatusCode connect(pool::ITransaction::Type type, unsigned int contextId=IPoolSvc::kInputStream) override
Connect to a logical database unit; PersistencySvc is chosen according to transaction type (accessmod...
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
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.
Gaudi::Property< std::string > m_fileOpen
FileOpen, the open mode for the file ("append" or "overwrite").
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.
DatabaseConnectionPolicy is a class holding information on the policy to be followed whenever a datab...
bool setWriteModeForExisting(Mode mode)
Sets the opening mode when an existing database is opened for writing.
bool setWriteModeForNonExisting(Mode mode)
Sets the opening mode when a non existing database is opened for writing Acceptable values are RAISE_...
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 OpenMode openMode() const =0
Returns the opening mode. It can be used to check whether the database is connected.
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 void connectForRead()=0
Connects explicitly to the database for read operations.
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.
Type
Transaction type enumeration.
virtual bool start(Type type=READ)=0
Starts a new transaction. Returns the success of the operation.
virtual bool isActive() const =0
Checks if the transaction is active.
std::string label(const std::string &format, int i)
static const DbType ROOT_StorageType
std::unique_ptr< ISession > createSession(IFileCatalog &catalog)
static const DbType POOL_StorageType
static void setLevel(MSG::Level l)