#include <SessionImpl.h>
Public Types | |
enum | FailureOnOpeningPolicy { THROW, DO_NOT_THROW, CREATE } |
Public Member Functions | |
void | close () |
void | commitTransaction () |
IGTSchema & | gtSchema () |
IIOVSchema & | iovSchema () |
bool | isActive () const |
bool | isTransactionActive (bool deep=true) const |
void | openDb () |
void | openGTDb (FailureOnOpeningPolicy policy=THROW) |
void | openIovDb (FailureOnOpeningPolicy policy=THROW) |
void | openRunInfoDb () |
void | rollbackTransaction () |
IRunInfoSchema & | runInfoSchema () |
SessionImpl () | |
SessionImpl (std::shared_ptr< coral::ISessionProxy > &session, const std::string &connectionString, const std::string &principalName) | |
void | startTransaction (bool readOnly=true) |
~SessionImpl () | |
Public Attributes | |
std::string | connectionString |
std::shared_ptr < coral::ISessionProxy > | coralSession |
std::unique_ptr< IGTSchema > | gtSchemaHandle |
std::unique_ptr< IIOVSchema > | iovSchemaHandle |
std::set< std::string > | lockedTags |
std::string | principalName |
std::unique_ptr< IRunInfoSchema > | runInfoSchemaHandle |
std::string | sessionHash |
std::unique_ptr< ITransaction > | transaction |
Private Member Functions | |
void | releaseTagLocks () |
Private Attributes | |
std::unique_lock < std::recursive_mutex > | transactionLock |
std::recursive_mutex | transactionMutex |
Definition at line 40 of file SessionImpl.h.
Enumerator | |
---|---|
THROW | |
DO_NOT_THROW | |
CREATE |
Definition at line 42 of file SessionImpl.h.
cond::persistency::SessionImpl::SessionImpl | ( | ) |
Definition at line 33 of file SessionImpl.cc.
cond::persistency::SessionImpl::SessionImpl | ( | std::shared_ptr< coral::ISessionProxy > & | session, |
const std::string & | connectionString, | ||
const std::string & | principalName | ||
) |
Definition at line 35 of file SessionImpl.cc.
References cond::auth::COND_SESSION_HASH_SIZE, cond::auth::KeyGenerator::make(), and sessionHash.
cond::persistency::SessionImpl::~SessionImpl | ( | ) |
void cond::persistency::SessionImpl::close | ( | void | ) |
Definition at line 45 of file SessionImpl.cc.
References commitTransaction(), coralSession, isActive(), lockedTags, releaseTagLocks(), rollbackTransaction(), startTransaction(), and transaction.
Referenced by esMonitoring.AsyncLineReaderMixin::handle_close(), esMonitoring.FDJsonServer::handle_close(), and ~SessionImpl().
void cond::persistency::SessionImpl::commitTransaction | ( | ) |
Definition at line 78 of file SessionImpl.cc.
References gtSchemaHandle, iovSchemaHandle, CommonMethods::lock(), runInfoSchemaHandle, transaction, and transactionLock.
Referenced by close(), and cond::persistency::Transaction::commit().
IGTSchema & cond::persistency::SessionImpl::gtSchema | ( | ) |
Definition at line 202 of file SessionImpl.cc.
References gtSchemaHandle.
IIOVSchema & cond::persistency::SessionImpl::iovSchema | ( | ) |
Definition at line 200 of file SessionImpl.cc.
References iovSchemaHandle.
Referenced by releaseTagLocks().
bool cond::persistency::SessionImpl::isActive | ( | ) | const |
Definition at line 60 of file SessionImpl.cc.
References coralSession.
Referenced by close().
bool cond::persistency::SessionImpl::isTransactionActive | ( | bool | deep = true | ) | const |
Definition at line 105 of file SessionImpl.cc.
References transaction.
Referenced by cond::persistency::Transaction::isActive().
void cond::persistency::SessionImpl::openDb | ( | ) |
Definition at line 179 of file SessionImpl.cc.
References gtSchemaHandle, iovSchemaHandle, cond::persistency::throwException(), and transaction.
void cond::persistency::SessionImpl::openGTDb | ( | SessionImpl::FailureOnOpeningPolicy | policy = THROW | ) |
Definition at line 149 of file SessionImpl.cc.
References CREATE, gtSchemaHandle, THROW, cond::persistency::throwException(), and transaction.
void cond::persistency::SessionImpl::openIovDb | ( | SessionImpl::FailureOnOpeningPolicy | policy = THROW | ) |
Definition at line 131 of file SessionImpl.cc.
References CREATE, iovSchemaHandle, THROW, cond::persistency::throwException(), and transaction.
void cond::persistency::SessionImpl::openRunInfoDb | ( | ) |
Definition at line 167 of file SessionImpl.cc.
References runInfoSchemaHandle, cond::persistency::throwException(), and transaction.
|
private |
Definition at line 113 of file SessionImpl.cc.
References mps_fire::action, cond::auth::COND_DBTAG_LOCK_ACCESS_CODE, cond::auth::COND_SESSION_HASH_CODE, cond::persistency::ITagLogTable::insert(), iovSchema(), lockedTags, lt, cond::persistency::ITagAccessPermissionTable::removeEntriesForCredential(), sessionHash, AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, cond::persistency::IIOVSchema::tagAccessPermissionTable(), cond::persistency::IIOVSchema::tagLogTable(), cond::persistency::IIOVSchema::tagTable(), and cond::persistency::ITagTable::unsetProtectionCode().
Referenced by close().
void cond::persistency::SessionImpl::rollbackTransaction | ( | ) |
Definition at line 93 of file SessionImpl.cc.
References gtSchemaHandle, iovSchemaHandle, CommonMethods::lock(), runInfoSchemaHandle, transaction, and transactionLock.
Referenced by close(), and cond::persistency::Transaction::rollback().
IRunInfoSchema & cond::persistency::SessionImpl::runInfoSchema | ( | ) |
Definition at line 204 of file SessionImpl.cc.
References runInfoSchemaHandle.
void cond::persistency::SessionImpl::startTransaction | ( | bool | readOnly = true | ) |
Definition at line 62 of file SessionImpl.cc.
References coralSession, gtSchemaHandle, iovSchemaHandle, CommonMethods::lock(), runInfoSchemaHandle, cond::persistency::throwException(), transaction, transactionLock, and transactionMutex.
Referenced by close(), and cond::persistency::Transaction::start().
std::string cond::persistency::SessionImpl::connectionString |
Definition at line 71 of file SessionImpl.h.
std::shared_ptr<coral::ISessionProxy> cond::persistency::SessionImpl::coralSession |
Definition at line 69 of file SessionImpl.h.
Referenced by close(), isActive(), and startTransaction().
std::unique_ptr<IGTSchema> cond::persistency::SessionImpl::gtSchemaHandle |
Definition at line 76 of file SessionImpl.h.
Referenced by commitTransaction(), gtSchema(), openDb(), openGTDb(), rollbackTransaction(), and startTransaction().
std::unique_ptr<IIOVSchema> cond::persistency::SessionImpl::iovSchemaHandle |
Definition at line 75 of file SessionImpl.h.
Referenced by commitTransaction(), iovSchema(), openDb(), openIovDb(), rollbackTransaction(), and startTransaction().
std::set<std::string> cond::persistency::SessionImpl::lockedTags |
Definition at line 73 of file SessionImpl.h.
Referenced by close(), and releaseTagLocks().
std::string cond::persistency::SessionImpl::principalName |
Definition at line 72 of file SessionImpl.h.
std::unique_ptr<IRunInfoSchema> cond::persistency::SessionImpl::runInfoSchemaHandle |
Definition at line 77 of file SessionImpl.h.
Referenced by commitTransaction(), openRunInfoDb(), rollbackTransaction(), runInfoSchema(), and startTransaction().
std::string cond::persistency::SessionImpl::sessionHash |
Definition at line 70 of file SessionImpl.h.
Referenced by releaseTagLocks(), and SessionImpl().
std::unique_ptr<ITransaction> cond::persistency::SessionImpl::transaction |
Definition at line 74 of file SessionImpl.h.
Referenced by close(), commitTransaction(), isTransactionActive(), openDb(), openGTDb(), openIovDb(), openRunInfoDb(), rollbackTransaction(), and startTransaction().
|
private |
Definition at line 82 of file SessionImpl.h.
Referenced by commitTransaction(), rollbackTransaction(), and startTransaction().
|
private |
Definition at line 81 of file SessionImpl.h.
Referenced by startTransaction().