7 #include "RelationalAccess/ITransaction.h"
9 #include "RelationalAccess/ConnectionService.h"
10 #include "RelationalAccess/ISessionProxy.h"
11 #include <boost/date_time/posix_time/posix_time_io.hpp>
16 namespace persistency {
26 explicit Table(coral::ISchema& schema) : m_schema(schema) {}
29 const boost::posix_time::ptime&
start,
30 const boost::posix_time::ptime&
end,
35 insertInTable(m_schema,
tname, dataToInsert.
get());
50 m_connectionString(
""),
61 dispatcher->unsubscribe();
71 if (!
m_log.str().empty())
73 m_startTime = boost::posix_time::microsec_clock::universal_time();
82 m_endTime = boost::posix_time::microsec_clock::universal_time();
85 log(
"END_JOB") <<
": return code:" << retCode;
92 boost::posix_time::time_facet* facet =
new boost::posix_time::time_facet();
93 facet->format(format_s);
95 timestamp.imbue(std::locale(std::locale::classic(), facet));
101 auto now = boost::posix_time::microsec_clock::universal_time();
105 auto now = boost::posix_time::microsec_clock::universal_time();
111 if (!
m_log.str().empty()) {
121 if (!
m_log.str().empty()) {
123 throwException(
"Connection string for destination database has not been provided.",
"Logger::saveOnDb");
125 coral::ConnectionService connServ;
126 std::unique_ptr<coral::ISessionProxy> coralSession(
128 coralSession->transaction().start(
false);
132 coralSession->transaction().commit();
134 coralSession->transaction().rollback();