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);
291 std::lock_guard<CallMutex> lock(*
m_pers_mut[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);
315 std::lock_guard<CallMutex> lock(*
m_pers_mut[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 APR 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) {
555 for (
unsigned long ipos = 0; ipos < ientry; ipos++) {
556 delete thisToken; thisToken = tokenIter->
next();
558 delete tokenIter; tokenIter =
nullptr;
565 ATH_MSG_WARNING(
"connect: Using default output Stream instead of id = " << contextId);
570 ATH_MSG_WARNING(
"connect: Using default input Stream instead of id = " << contextId);
573 ATH_MSG_INFO(
"Connecting to InputStream for: " << contextId);
578 return(StatusCode::FAILURE);
583 if (session->transaction().isActive()) {
584 return(StatusCode::SUCCESS);
586 if (!session->start(
type)) {
588 return(StatusCode::FAILURE);
591 return(StatusCode::SUCCESS);
596 return(StatusCode::FAILURE);
600 if (session !=
nullptr && session->transaction().isActive()) {
601 if (!session->commit()) {
603 return(StatusCode::FAILURE);
606 session->disconnectAll();
609 return(StatusCode::SUCCESS);
614 return(StatusCode::FAILURE);
621 return(StatusCode::FAILURE);
624 return(StatusCode::SUCCESS);
628 ATH_MSG_DEBUG(
"Disconnect request for contextId=" << contextId);
630 return(StatusCode::SUCCESS);
635 if (!
commit(contextId).isSuccess()) {
637 return(StatusCode::FAILURE);
642 ATH_MSG_ERROR(
"disconnect failed to diconnect PersistencySvc");
643 return(StatusCode::FAILURE);
646 return(StatusCode::SUCCESS);
651 return(StatusCode::SUCCESS);
654 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, connection);
655 if (dbH ==
nullptr) {
657 return(StatusCode::FAILURE);
659 std::map<unsigned int, unsigned int>::const_iterator maxFileIter =
m_contextMaxFile.find(contextId);
661 m_guidLists[contextId].remove(
Guid(dbH->fid()));
664 return(StatusCode::SUCCESS);
670 unsigned int contextId)
const {
672 ATH_MSG_WARNING(
"getAttribute: Using default input Stream instead of id = " << contextId);
677 std::ostringstream oss;
678 if (
data ==
"DbLonglong") {
680 }
else if (
data ==
"double") {
687 return(StatusCode::SUCCESS);
693 const std::string& dbName,
694 const std::string& contName,
695 unsigned int contextId)
const {
697 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
698 if (dbH ==
nullptr) {
699 ATH_MSG_DEBUG(
"getAttribute: Failed to get Session/DatabaseHandle to get POOL property.");
700 return(StatusCode::FAILURE);
704 dbH->setTechnology(tech);
705 dbH->connectForWrite();
707 dbH->connectForRead();
710 std::ostringstream oss;
711 if (contName.empty()) {
712 if (
data ==
"DbLonglong") {
713 oss << std::dec << dbH->technologySpecificAttributes().attribute<
long long int>(optName);
714 }
else if (
data ==
"double") {
715 oss << std::dec << dbH->technologySpecificAttributes().attribute<
double>(optName);
716 }
else if (
data ==
"string") {
717 oss << dbH->technologySpecificAttributes().attribute<
char*>(optName);
719 oss << std::dec << dbH->technologySpecificAttributes().attribute<
int>(optName);
721 ATH_MSG_INFO(
"Database (" << dbH->pfn() <<
") attribute [" << optName <<
"]" <<
": " << oss.str());
724 if (contH ==
nullptr) {
725 ATH_MSG_DEBUG(
"Failed to get ContainerHandle to get POOL property.");
726 return(StatusCode::FAILURE);
728 if (
data ==
"DbLonglong") {
729 oss << std::dec << contH->technologySpecificAttributes().attribute<
long long int>(optName);
730 }
else if (
data ==
"double") {
731 oss << std::dec << contH->technologySpecificAttributes().attribute<
double>(optName);
733 oss << std::dec << contH->technologySpecificAttributes().attribute<
int>(optName);
735 ATH_MSG_INFO(
"Container attribute [" << contName <<
"." << optName <<
"]: " << oss.str());
738 return(StatusCode::SUCCESS);
742 const std::string&
data,
744 unsigned int contextId)
const {
746 ATH_MSG_WARNING(
"setAttribute: Using default output Stream instead of id = " << contextId);
754 return(StatusCode::FAILURE);
759 return(StatusCode::FAILURE);
762 return(StatusCode::SUCCESS);
766 const std::string&
data,
768 const std::string& dbName,
769 const std::string& contName,
770 unsigned int contextId)
const {
772 ATH_MSG_WARNING(
"setAttribute: Using default output Stream instead of id = " << contextId);
776 std::unique_ptr<pool::IDatabase> dbH =
getDbHandle(contextId, dbName);
777 if (dbH ==
nullptr) {
778 ATH_MSG_DEBUG(
"Failed to get Session/DatabaseHandle to set POOL property.");
779 return(StatusCode::FAILURE);
783 dbH->setTechnology(tech);
784 dbH->connectForWrite();
786 dbH->connectForRead();
789 bool retError =
false;
791 bool hasTTreeName = (contName.length() > 6 && contName.compare(0, 6,
"TTree=") == 0);
793 objName = hasTTreeName ? contName.substr(6) : contName;
795 retError = dbH->technologySpecificAttributes().setAttribute(optName,
data.c_str(), objName);
796 }
else if(
data[
data.size() - 1] ==
'L' ) {
797 retError = dbH->technologySpecificAttributes().setAttribute<
long long int>(optName, atoll(
data.c_str()), objName);
799 retError = dbH->technologySpecificAttributes().setAttribute<
int>(optName, atoi(
data.c_str()), objName);
803 return(StatusCode::FAILURE);
807 if (contH ==
nullptr) {
808 ATH_MSG_DEBUG(
"Failed to get ContainerHandle to set POOL property.");
809 return(StatusCode::FAILURE);
811 if (
auto p = contName.find(
'('); p != std::string::npos) {
812 objName = contName.substr(p + 1);
813 objName.erase(objName.find(
')'));
814 }
else if (
auto p = contName.find(
"::"); p != std::string::npos) {
815 objName = contName.substr(p + 2);
816 }
else if (
auto p = contName.find(
'_'); p != std::string::npos) {
817 objName = contName.substr(p + 1);
818 objName.erase(objName.find(
'/'));
820 std::string::size_type off = 0;
821 while ((off = objName.find_first_of(
"<>/")) != std::string::npos) {
825 retError = contH->technologySpecificAttributes().setAttribute<
long long int>(optName, atoll(
data.c_str()), objName);
827 retError = contH->technologySpecificAttributes().setAttribute<
int>(optName, atoi(
data.c_str()), objName);
830 ATH_MSG_DEBUG(
"Failed to set POOL container property, " << optName <<
" for " << contName <<
" : " << objName <<
" to " <<
data);
831 return(StatusCode::FAILURE);
834 return(StatusCode::SUCCESS);
842 std::vector<std::string> physcons;
843 if (conn.find(
':') == std::string::npos) {
846 const std::string lookSvcStr(
"CORAL/Services/XMLLookupService");
847 coral::IHandle<coral::ILookupService> lookSvcH =
m_context->query<coral::ILookupService>();
848 if (!lookSvcH.isValid()) {
850 lookSvcH =
m_context->query<coral::ILookupService>();
852 if (!lookSvcH.isValid()) {
854 return(StatusCode::FAILURE);
856 coral::IDatabaseServiceSet* dbset = lookSvcH->lookup(conn, coral::ReadOnly);
857 if (dbset !=
nullptr) {
858 for (
int irep = 0, nrep = dbset->numberOfReplicas(); irep < nrep; ++irep) {
859 const std::string pcon = dbset->replica(irep).connectionString();
860 if (pcon.compare(0, 9,
"frontier:") == 0) {
861 physcons.push_back(std::move(pcon));
864 delete dbset; dbset =
nullptr;
866 ATH_MSG_DEBUG(
"setFrontierCache: Could not find any replicas for " << conn);
868 }
else if (conn.compare(0, 9,
"frontier:") == 0) {
869 physcons.push_back(conn);
872 if (physcons.size() == 0) {
873 return(StatusCode::SUCCESS);
875 coral::ConnectionService conSvcH;
879 coral::IWebCacheControl& webCache = conSvcH.webCacheControl();
880 for (
const auto& physcon : physcons) {
882 if (std::find(refreshList.begin(), refreshList.end(), physcon) == refreshList.end()
883 && std::find(refreshList.begin(), refreshList.end(), conn) == refreshList.end()) {
886 webCache.refreshTable(physcon,
"DUMMYTABLE");
889 webCache.refreshSchemaInfo(physcon);
891 ATH_MSG_DEBUG(
"Cache flag for connection " << physcon <<
" set to " << webCache.webCacheInfo(physcon).isSchemaInfoCached());
893 return(StatusCode::SUCCESS);
901 if (
catalog.compare(0, 8,
"apcfile:") == 0 ||
catalog.compare(0, 7,
"prfile:") == 0) {
902 std::string::size_type cpos =
catalog.find(
':');
917 <<
" in $ATLAS_POOLCOND_PATH and $DATAPATH");
927 }
catch(std::exception& e) {
928 ATH_MSG_ERROR(
"setWriteCatalog - caught exception: " << e.what());
938std::unique_ptr<pool::IDatabase>
PoolSvc::getDbHandle(
unsigned int contextId,
const std::string& dbName)
const {
940 ATH_MSG_WARNING(
"getDbHandle: Using default input Stream instead of id = " << contextId);
955 if (dbName.compare(0, 4,
"PFN:") == 0) {
957 }
else if (dbName.compare(0, 4,
"LFN:") == 0) {
959 }
else if (dbName.compare(0, 4,
"FID:") == 0) {
967 if (dbH ==
nullptr) {
974 if (contName.find(
"DataHeader") != std::string::npos) {
979 return(std::unique_ptr<pool::IContainer>(contH));
985 const char* cpath = std::getenv(
"ATLAS_POOLCOND_PATH");
986 if (cpath && strcmp(cpath,
"") != 0) {
987 const std::string testpath = std::string(cpath) +
"/" + leaf;
991 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]
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.
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.
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::vector< pool::PersistencySvc::ISession * > m_dbSessionVec
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.
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.
ITokenIterator is the interface class for iterators of tokens.
virtual Token * next()=0
Returns the pointer to next token.
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.
ISession is the interface class for user (macroscopic) sessions Every transaction and connection to a...
virtual ITransaction & transaction()=0
Returns the transaction interface.
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 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.
std::string label(const std::string &format, int i)
std::unique_ptr< ISession > createSession(IFileCatalog &catalog)
static const DbType ROOT_StorageType
static const DbType POOL_StorageType
static void setLevel(MSG::Level l)