7 namespace persistency {
10 m_session( &session ){
14 m_session( rhs.m_session ){
40 m_transaction( *m_session ){
44 m_session( sessionImpl ),
45 m_transaction( *m_session ){
49 m_session( rhs.m_session ),
50 m_transaction( rhs.m_transaction ){
73 return m_session->transaction->iovDbExists;
84 proxy.
load( tag, full );
89 const boost::posix_time::ptime& snapshottime,
93 proxy.
load( tag, snapshottime, full );
99 return m_session->iovSchema().tagTable().select( tag );
111 if(
m_session->iovSchema().tagTable().select( tag ) )
112 throwException(
"The specified tag \""+tag+
"\" already exist in the database.",
"Session::createIov");
121 const boost::posix_time::ptime& creationTime ){
123 if(
m_session->iovSchema().tagTable().select( tag ) )
124 throwException(
"The specified tag \""+tag+
"\" already exist in the database.",
"Session::createIov");
132 if(
m_session->iovSchema().tagTable().select( tag ) )
133 throwException(
"The specified tag \""+tag+
"\" already exist in the database.",
"Session::createIovForPayload");
135 if( !
m_session->iovSchema().payloadTable().getType( payloadHash, payloadType ) )
136 throwException(
"The specified payloadId \""+payloadHash+
"\" does not exist in the database.",
"Session::createIovForPayload");
150 m_session->iovSchema().iovTable().erase( tag );
155 return m_session->gtSchema().gtTable().select( name );
160 if(
m_session->gtSchema().gtTable().select( name ) )
161 throwException(
"The specified Global Tag \""+name+
"\" already exist in the database.",
"Session::createGlobalTag");
183 proxy.
load( name, preFix, postFix );
188 const std::pair<Binary,Binary>& payloadAndStreamerInfoData,
189 const boost::posix_time::ptime& creationTime ){
191 return m_session->iovSchema().payloadTable().insertIfNew( payloadObjectType, payloadAndStreamerInfoData.first,
192 payloadAndStreamerInfoData.second, creationTime );
200 return m_session->iovSchema().payloadTable().select( payloadHash, payloadType, payloadData, streamerInfoData );
212 if(!
m_session->iovSchema().tagMigrationTable().exists() )
m_session->iovSchema().tagMigrationTable().create();
214 return m_session->iovSchema().tagMigrationTable().select( sourceAccount, sourceTag, destTag, (
int&)status );
222 if(!
m_session->iovSchema().tagMigrationTable().exists() )
m_session->iovSchema().tagMigrationTable().create();
223 m_session->iovSchema().tagMigrationTable().insert( sourceAccount, sourceTag, destTag, (
int)status,
224 boost::posix_time::microsec_clock::universal_time() );
231 if(!
m_session->iovSchema().tagMigrationTable().exists() )
232 throwException(
"Migration Log Table does not exist in this schema.",
"Session::updateMigrationLog");
233 m_session->iovSchema().tagMigrationTable().updateValidationCode( sourceAccount, sourceTag, (
int)status );
240 if(!
m_session->iovSchema().payloadMigrationTable().exists() )
return false;
241 return m_session->iovSchema().payloadMigrationTable().select( sourceAccount, sourceToken, payloadId );
248 if(!
m_session->iovSchema().payloadMigrationTable().exists() )
m_session->iovSchema().payloadMigrationTable().create();
249 m_session->iovSchema().payloadMigrationTable().insert( sourceAccount, sourceToken, payloadId,
250 boost::posix_time::microsec_clock::universal_time() );
257 if(!
m_session->iovSchema().payloadMigrationTable().exists() )
258 throwException(
"Payload Migration Table does not exist in this schema.",
"Session::updateMigratedPayload");
259 m_session->iovSchema().payloadMigrationTable().update( sourceAccount, sourceToken, payloadId,
260 boost::posix_time::microsec_clock::universal_time() );
265 return m_session->iovSchema().parsePoolToken( poolToken );
282 m_transaction(transaction),m_status(
true){
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)
void addMigratedPayload(const std::string &sourceAccount, const std::string &sourceToken, const std::string &payloadId)
void clearIov(const std::string &tag)
void load(const std::string &tag, bool full=false)
void start(bool readOnly=true)
IOVEditor createIov(const std::string &tag, cond::TimeType timeType, cond::SynchronizationType synchronizationType=cond::SYNCH_ANY)
void load(const std::string &tag)
Transaction & m_transaction
TransactionScope(Transaction &transaction)
Transaction & transaction()
void updateMigrationLog(const std::string &sourceAccount, const std::string &sourceTag, cond::MigrationStatus status)
IOVProxy readIov(const std::string &tag, bool full=false)
Transaction & operator=(const Transaction &rhs)
void load(const std::string >Name, const std::string &preFix="", const std::string &postFix="")
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)
void startTransaction(bool readOnly=true)
std::string parsePoolToken(const std::string &poolToken)
bool existsIov(const std::string &tag)
coral::ISessionProxy & coralSession()
bool lookupMigratedPayload(const std::string &sourceAccount, const std::string &sourceToken, std::string &payloadId)
bool isTransactionActive(bool deep=true) const
IOVEditor createIovForPayload(const Hash &payloadHash, const std::string &tag, cond::TimeType timeType, cond::SynchronizationType synchronizationType=cond::SYNCH_ANY)
GTEditor createGlobalTag(const std::string &name)
void rollbackTransaction()
Session & operator=(const Session &rhs)
GTProxy readGlobalTag(const std::string &name)
void load(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)