1 #ifndef RecoLuminosity_LumiProducer_HLTConfDummy2DB_h 2 #define RecoLuminosity_LumiProducer_HLTConfDummy2DB_h 3 #include "RelationalAccess/ConnectionService.h" 4 #include "RelationalAccess/ISessionProxy.h" 5 #include "RelationalAccess/ITransaction.h" 6 #include "RelationalAccess/ISchema.h" 7 #include "RelationalAccess/IQuery.h" 8 #include "RelationalAccess/ICursor.h" 9 #include "RelationalAccess/ITable.h" 10 #include "RelationalAccess/ITableDataEditor.h" 11 #include "RelationalAccess/IBulkOperation.h" 12 #include "CoralBase/AttributeList.h" 13 #include "CoralBase/AttributeSpecification.h" 14 #include "CoralBase/Attribute.h" 15 #include "CoralBase/Exception.h" 42 coral::ConnectionService* svc =
new coral::ConnectionService;
47 coral::ISessionProxy* session = svc->connect(
m_dest, coral::Update);
49 unsigned int totalhltpath = 126;
50 session->transaction().start(
false);
51 coral::ISchema& schema = session->nominalSchema();
53 coral::AttributeList hltconfData;
57 coral::IBulkOperation* hltconfInserter = hltconftable.dataEditor().bulkInsert(hltconfData, 200);
61 hltconfData[
"HLTKEY"].data<
std::string>() = fakehltkey;
64 for (
unsigned int i = 1;
i <= totalhltpath; ++
i) {
66 ::sprintf(
c,
"-%d",
i);
69 hltconfInserter->processNextIteration();
71 hltconfInserter->flush();
72 delete hltconfInserter;
73 session->transaction().commit();
75 std::cout <<
"database problem " << er.what() << std::endl;
76 session->transaction().rollback();
const std::string sourceType() const override
~HLTConfDummy2DB() override
const std::string dataType() const override
void setAuthentication(const std::string &authPath)
HLTConfDummy2DB(const std::string &dest)
static const std::string trghltMapTableName()
#define DEFINE_EDM_PLUGIN(factory, type, name)
unsigned long long retrieveData(unsigned int runnumber) override