1 #ifndef CondCore_CondDB_Session_h
2 #define CondCore_CondDB_Session_h
25 #include <boost/shared_ptr.hpp>
36 namespace persistency {
38 class SessionConfiguration;
47 void start(
bool readOnly=
true );
65 explicit Session(
const std::shared_ptr<SessionImpl>& sessionImpl );
95 const boost::posix_time::ptime& snapshottime,
104 template <
typename T>
117 const boost::posix_time::ptime& creationTime );
131 const boost::posix_time::ptime& creationTime = boost::posix_time::microsec_clock::universal_time() );
189 const std::pair<Binary,Binary>& payloadAndStreamerInfoData,
190 const boost::posix_time::ptime& creationTime );
210 throwException(
"Payload of type "+payloadObjectType+
" could not be stored. "+em,
"Session::storePayload");
219 if(!
fetchPayloadData( payloadHash, payloadType, payloadData, streamerInfoData ) )
220 throwException(
"Payload with id "+payloadHash+
" has not been found in the database.",
221 "Session::fetchPayload" );
222 boost::shared_ptr<T>
ret;
227 throwException(
"Payload of type "+payloadType+
" with id "+payloadHash+
" could not be loaded. "+em,
"Session::fetchPayload");
238 void start(
bool readOnly=
true );
virtual char const * what() const
void addToMigrationLog(const std::string &sourceAccount, const std::string &sourceTag, const std::string &destinationTag, cond::MigrationStatus status)
GTEditor editGlobalTag(const std::string &name)
Transaction(SessionImpl &session)
bool existsGlobalTag(const std::string &name)
void updateMigratedPayload(const std::string &sourceAccount, const std::string &sourceToken, const std::string &payloadId)
Base exception class for the object to relational access.
void addMigratedPayload(const std::string &sourceAccount, const std::string &sourceToken, const std::string &payloadId)
void clearIov(const std::string &tag)
boost::shared_ptr< T > fetchPayload(const cond::Hash &payloadHash)
void start(bool readOnly=true)
IOVEditor createIov(const std::string &tag, cond::TimeType timeType, cond::SynchronizationType synchronizationType=cond::SYNCH_ANY)
Transaction & m_transaction
TransactionScope(Transaction &transaction)
Transaction & transaction()
void updateMigrationLog(const std::string &sourceAccount, const std::string &sourceTag, cond::MigrationStatus status)
std::string demangledName(const std::type_info &typeInfo)
IOVProxy readIov(const std::string &tag, bool full=false)
Transaction & operator=(const Transaction &rhs)
coral::ISchema & nominalSchema()
void start(bool readOnly=true)
bool fetchPayloadData(const cond::Hash &payloadHash, std::string &payloadType, cond::Binary &payloadData, cond::Binary &streamerInfoData)
std::string connectionString()
cond::Hash storePayloadData(const std::string &payloadObjectType, const std::pair< Binary, Binary > &payloadAndStreamerInfoData, const boost::posix_time::ptime &creationTime)
IOVEditor editIov(const std::string &tag)
std::string parsePoolToken(const std::string &poolToken)
bool existsIov(const std::string &tag)
std::pair< Binary, Binary > serialize(const T &payload, bool packingOnly=false)
cond::Hash storePayload(const T &payload, const boost::posix_time::ptime &creationTime=boost::posix_time::microsec_clock::universal_time())
coral::ISessionProxy & coralSession()
bool lookupMigratedPayload(const std::string &sourceAccount, const std::string &sourceToken, std::string &payloadId)
IOVEditor createIovForPayload(const Hash &payloadHash, const std::string &tag, cond::TimeType timeType, cond::SynchronizationType synchronizationType=cond::SYNCH_ANY)
GTEditor createGlobalTag(const std::string &name)
Session & operator=(const Session &rhs)
GTProxy readGlobalTag(const std::string &name)
Transaction m_transaction
void throwException(const std::string &message, const std::string &methodName)
std::shared_ptr< SessionImpl > m_session
bool checkMigrationLog(const std::string &sourceAccount, const std::string &sourceTag, std::string &destinationTag, cond::MigrationStatus &status)