8 namespace persistency {
15 std::vector<std::tuple<cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime> >
runBuffer;
16 std::vector<std::tuple<cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime> >
updateBuffer;
50 const boost::posix_time::ptime&
start,
51 const boost::posix_time::ptime&
end) {
57 const boost::posix_time::ptime&
start,
58 const boost::posix_time::ptime&
end) {
71 boost::posix_time::ptime& newRunStart = std::get<1>(
update);
72 boost::posix_time::ptime& newRunEnd = std::get<2>(
update);
73 boost::posix_time::ptime existingRunStart;
74 boost::posix_time::ptime existingRunEnd;
75 if (
m_session->runInfoSchema().runInfoTable().select(newRun, existingRunStart, existingRunEnd)) {
76 if (newRunStart != existingRunStart) {
77 std::stringstream
msg;
78 msg <<
"Attempt to update start time of existing run " << newRun;
81 if (existingRunEnd == newRunEnd) {
85 if (existingRunEnd != existingRunStart) {
86 std::stringstream
msg;
87 msg <<
"Attempt to update end time of existing run " << newRun;
91 m_session->runInfoSchema().runInfoTable().updateEnd(newRun, newRunEnd);
93 m_session->runInfoSchema().runInfoTable().insertOne(newRun, newRunStart, newRunEnd);
98 m_data->updateBuffer.clear();
106 if (!
m_session->isTransactionActive(
false))
void insert(cond::Time_t runNumber, const boost::posix_time::ptime &start, const boost::posix_time::ptime &end)
ret
prodAgent to be discontinued
void insertNew(cond::Time_t runNumber, const boost::posix_time::ptime &start, const boost::posix_time::ptime &end)
RunInfoEditor & operator=(const RunInfoEditor &rhs)
std::vector< std::tuple< cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime > > runBuffer
std::vector< std::tuple< cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime > > updateBuffer
unsigned long long Time_t
void checkTransaction(const std::string &ctx)
std::shared_ptr< RunInfoEditorData > m_data
std::shared_ptr< SessionImpl > m_session
void throwException(const std::string &message, const std::string &methodName)
cond::Time_t getLastInserted()