8 namespace persistency {
18 std::vector<std::tuple<cond::Time_t,boost::posix_time::ptime,boost::posix_time::ptime> >
runBuffer;
19 std::vector<std::tuple<cond::Time_t,boost::posix_time::ptime,boost::posix_time::ptime> >
updateBuffer;
54 return m_session->runInfoSchema().runInfoTable().getLastInserted();
60 if(
m_data.get() )
m_data->runBuffer.push_back( std::tie( runNumber, start, end ) );
64 if(
m_data.get() )
m_data->updateBuffer.push_back( std::tie( runNumber, start, end ) );
72 ret +=
m_data->runBuffer.size();
75 boost::posix_time::ptime& newRunStart = std::get<1>(
update);
76 boost::posix_time::ptime& newRunEnd = std::get<2>(
update);
77 boost::posix_time::ptime existingRunStart;
78 boost::posix_time::ptime existingRunEnd;
79 if(
m_session->runInfoSchema().runInfoTable().select( newRun, existingRunStart, existingRunEnd ) ){
80 if( newRunStart!=existingRunStart ) {
81 std::stringstream
msg;
82 msg<<
"Attempt to update start time of existing run "<< newRun;
85 if( existingRunEnd == newRunEnd ){
89 if( existingRunEnd!=existingRunStart ){
90 std::stringstream
msg;
91 msg<<
"Attempt to update end time of existing run "<< newRun;
95 m_session->runInfoSchema().runInfoTable().updateEnd( newRun, newRunEnd );
97 m_session->runInfoSchema().runInfoTable().insertOne( newRun, newRunStart, newRunEnd );
101 m_data->runBuffer.clear();
102 m_data->updateBuffer.clear();
void insert(cond::Time_t runNumber, const boost::posix_time::ptime &start, const boost::posix_time::ptime &end)
void insertNew(cond::Time_t runNumber, const boost::posix_time::ptime &start, const boost::posix_time::ptime &end)
std::vector< std::tuple< cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime > > updateBuffer
RunInfoEditor & operator=(const RunInfoEditor &rhs)
unsigned long long Time_t
std::vector< std::tuple< cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime > > runBuffer
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()