9 using namespace oracle::occi;
33 this->checkConnection();
36 m_writeStmt = m_conn->createStatement();
37 m_writeStmt->setSQL(
"INSERT INTO run_FEConfig_dat (iov_id, logic_id, "
39 "VALUES (:iov_id, :logic_id, "
42 throw(std::runtime_error(
"RunFEConfigDat::prepareWrite(): "+e.getMessage()));
51 this->checkConnection();
54 int iovID =
iov->fetchID();
55 if (!iovID) {
throw(std::runtime_error(
"RunFEConfigDat::writeDB: IOV not in DB")); }
57 int logicID = ecid->getLogicID();
58 if (!logicID) {
throw(std::runtime_error(
"RunFEConfigDat::writeDB: Bad EcalLogicID")); }
61 m_writeStmt->setInt(1, iovID);
62 m_writeStmt->setInt(2, logicID);
63 m_writeStmt->setInt(3, item->getConfigId());
66 m_writeStmt->executeUpdate();
68 throw(std::runtime_error(
"RunFEConfigDat::writeDB(): "+e.getMessage()));
77 this->checkConnection();
80 iov->setConnection(m_env, m_conn);
81 int iovID =
iov->fetchID();
91 Statement* stmt = m_conn->createStatement();
92 stmt->setSQL(
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
94 "FROM channelview cv JOIN run_FEConfig_dat d "
95 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to "
96 "WHERE d.iov_id = :iov_id");
97 stmt->setInt(1, iovID);
102 std::pair< EcalLogicID, RunFEConfigDat >
p;
104 while(rset->next()) {
118 m_conn->terminateStatement(stmt);
120 throw(std::runtime_error(
"RunFEConfigDat::fetchData(): "+e.getMessage()));
oracle::occi::SQLException SQLException
void writeDB(const EcalLogicID *ecid, const RunFEConfigDat *item, RunIOV *iov) noexcept(false)
void prepareWrite() noexcept(false)
oracle::occi::ResultSet ResultSet
volatile std::atomic< bool > shutdown_flag false
void fetchData(std::map< EcalLogicID, RunFEConfigDat > *fillMap, RunIOV *iov) noexcept(false)